I have asked for some help on this list recently. I am trying to learn enough
of both the hardware and software needed to accomplish my first project. I am
a mechanic by trade and have very little programming experience. I can
however understand schematics and have no problem building what I need as far
as the hardware goes. My problem is really two fold. I need a schematic so I
can first build this project and then I need the software to drive it. I have
MPlab V5.0 but I am not sure where to start. My project is rather simple. I
am trying to build a speedometer for our model railroad. HO scale 1:87 ratio.
I have two track detectors already and the PIC. I have two "Seven segment"
LED's that I want to use for the display. I understand that I will have to
multiplex the display to reduce th I/O port requirement.
Several members of this list sent me to pages with examples on how to drive a
single digit display. There was some text outlineing the multiplexing idea
but no code or schematic. I am sure someone out here could whip this up in a
few minutes!
I have spent several hours just doing research already.
If anyone out there could get me through this first project I would be very
greatful!
After that the mechanic in me can tear this one apart and make changes so I
can learn the ropes! I need a door of widom opened here please!
Ray Russell
General Contractor
Norfolk & Western Railroad
You have segments, and digits.
The segments control what char gets displayed.
The digits control where it is.
In hardware, you'll need seven output bits for the segments, with current
limiting resistors in each line.
You'll also need three outputs for digits.
Check your display docs as to wether the digit output needs to be high to
make the digits active, or low. The segments of course need to be the opposite.
If you wanted to output "123", you'd first build a routine to translate
"1", "2", and "3" into segment patterns. This is pretty easy, using a
table. One byte per digit, with a bit to spare.
Once you have your digit table, you select which digit you're going to
display by activating the digit outputs in sequence.
The way I would attack this, is to make a 3 byte area in ram to hold the
binary (or ascii) values that are to be displayed.
Then I would read them in turn, and for each one translate, output the
bits, wait a short while (maybe 10mS) then on to the next digit.
At this point, you have a scanned display, and you can change the display
by just rewriting the ram contents in the display buffer.
David,
Thanks for your very quick reply!
While I understand the theory, putting what you are saying to use has left me
out in the cold!
Do you have a program that would do all this that you could add notes to that
tell me what each line is doing? This way I could go to the data sheet and
actually figure out what is going on? This way I am not burning up hours
beating my head against the wall.
I have gotten several posts from this list but they all figure I know how to
use the compiler and know how to write code. I am so lost I wanna dump the
whole thing but everyone keeps telling me it is so simple! I am wondering if
I am getting old or just to dumb to understand this!
I hope you can see where I am and throw me a rope!
Ray Russell
General Contractor
Norfolk & Western Railroad
Start really simple. DO NOT attempt to write the train speed controller
until you are really happy with the writing , assembling and programming of
your code.
Start simple. Flash an LED. It's supprising the amount of things you have to
think of just to flash an LED. This deals with the fundamentals of setting
up the chip correctly and control I/O ports. Once you get that working you
can gradually migrate to bigger and better programs.
If you start too big you'll never know if it's your code, the assembler
(tools), the programmer or the hardware you've designed.
Go from controlling one LED to writing to your serial to parallel chip (or
whatever it was) but stick LED's on the output of the other chip. Then but
very large delays in your code and visually watch the signals propagate
through the PIC and through the other chip out to the LED's.
Then worry about what data you are sending, and in what order and timing.
The last thing to do is connect the 7-segment LED's.
Do all this with absolutely NO input to the PIC. Just make some random data
up and write this out of the chip to the 7-seg' LED's.
Then maybe progress to sampling an input pin and making a measurement of it.
Display the result on the LED's. Finally take the measurement and
scale/calibrate or signal process in what ever manner you like and send it
to the LED's.
The biggest key is to start simple and build up the project bit by bit and
only progress onto the next bit when you are happy you know what it's doing.
Your first project will probably take a long time so stick with it. You
cannot learn about the PIC and program and build your first large project
all in one day.
As someone else stated, start with a much simpler project.
Like, just blink an LED on and off in response to a pushbutton. Yes, I
know, it sounds boring, but you'll learn a LOT along the way, and have a LOT
less frustration than getting a speedometer to work. Just building this
simple project might be more work than the rest of the way to a working
speedometer.
Surf the web and try one of the many starter projects. Just breadboard the
circuit and use the sampe code verbatim to learn how it all works. Then
tweak the sample code and notice the changes you can effect. You'll quickly
build the skills to do a more complex project like a speedometer. And
that's not meant to be patronzing; it's a very real truth that deserves a
lot more credit than it sounds like. Starting simply and slowly adding
functions also prevents the whole overwhelming thing that makes you want to
give up.
My first project was a digital thermostat, and I started very simply: first,
flash one segment of one 7-segment LED. Then write a lookup table and
sequence 0,1,2,3,4,5,6,7,8,9 to the LED. Etc. I must've erased and
reprogrammed that sucker a jillion times, adding just a few instructions to
my code each time, but if something broke, I always knew where to look.
(Yep, I used the MAX7219 on that project!)
Gee, all this talk about the MAX7219, I might have to dig up my old code and
post it here for all. (But it's 2 AM at the moment and I have to go to work
in the morning, so Ray, if you'll remind me in a private email, I'll post
publicly.)
BTW, Ray, the subject of this thread should start with [PIC]: according to
the frequently asked questions (FAW) for the list at http://www.piclist.com
I would suggest first getting a blinking led going as others suggest, this will
get you into using the files that come with MPASM and how they work and specify
different parameters for the config word. It will also get you sorted with using
the timer and interrupts to set the time the led is off and on.
Then start to work out your 7 segment display by driving only one digit. I
envisage that this would build on the blinking led code by having the timer
count up a register that you would then display on the 7 segment display. This
will get you into using table data to convert from binary to 7 segment data.
Then expand the display to 2 digits. this will now get you into using the timer
to do 2 things at once (multiplex display at high rate while counting at low
rate) and also how to do the multiplex driving.
You are now about ready to start investigating the basics of the desired
project, while having a fair chunk of the output side of the code working, which
will assist the debugging of the project.
>> He who suspects the compiler first has a lot yet to learn.
He who suspects the compiler may have modified the compiler...
I remember once I typed in a good part of an 8080 forth implementation from
Kilobaud magazine. Then I ran it through the cross assembler (that I had
written) and loaded it up into the 8085 simulator (that I had written) on
the DEC mainframe. It didn't work... and I suddenly realized that I had
FOUR probable sources of error, and three of them would be my fault! That's
without counting improbable sources of error like errors in the assembler
that the cross assembler had been written in...
Ray Russell wrote:
>
> David,
> Thanks for your very quick reply!
> While I understand the theory, putting what you are saying to use has left me
> out in the cold!
> Do you have a program that would do all this that you could add notes to that
> tell me what each line is doing? This way I could go to the data sheet and
> actually figure out what is going on? This way I am not burning up hours
> beating my head against the wall.
> I have gotten several posts from this list but they all figure I know how to
> use the compiler and know how to write code. I am so lost I wanna dump the
> whole thing but everyone keeps telling me it is so simple! I am wondering if
> I am getting old or just to dumb to understand this!
> I hope you can see where I am and throw me a rope!
> Ray Russell
> General Contractor
> Norfolk & Western Railroad
Russell, sounds like techno-shock rearing it's
ugly head. There is a steep learning curve with
PICs (or any micros) it all seems impossible at
first, then after a few weeks most of it makes
sense.
David was right about starting small. Get a simple
easy to program PIC like the 16F84. Then attach
the two opto sensors to it's two input pins. Then
set two other pins to outputs, and just "mirror"
the ins to outs. So when the train passes opto 1
you light led 1. When it passes opto 2 you light
led 2. The circuit and code for that would both be
pretty simple and easy for mentors to help with. :o)
By the time you get that happening with software
and hardware you are really most of the way there.
I also expect by the time that is working you
will have gotten the PIC bug bad enough to be
itching to attack bigger and better things, like
connecting the 7-seg displays and doing some timing
calcs.
Don't ever think you're too old or dumb! I'm sure
you have knowlege and skills that other people here
will never have. Would you think that we're dumb
because of that? Give yourself the same credit. :o)
-Roman
I would say for your "first" project to simply
make an LED blink on and off.. I know that sounds
"too" simple, but it's really a help in getting to
know the compiler, your programmer, how everything
fit's together... There are several different
examples of blink (or walking) LED circuits &
.asm code out there. I would also check out
www.piclist.com/techref/piclist/begin.htm
it has alot of good information for getting started
on there. Another page with some useful information
in your situation would be: http://www.piclist.com/techref/io/led/pic.htm
It has examples for exactly what you want to do.
> David,
> Thanks for your very quick reply!
> While I understand the theory, putting what you are saying to use has
> left me
> out in the cold!
> Do you have a program that would do all this that you could add notes
> to that
> tell me what each line is doing? This way I could go to the data
> sheet and
> actually figure out what is going on? This way I am not burning up
> hours
> beating my head against the wall.
> I have gotten several posts from this list but they all figure I know
> how to
> use the compiler and know how to write code. I am so lost I wanna
> dump the
> whole thing but everyone keeps telling me it is so simple! I am
> wondering if
> I am getting old or just to dumb to understand this!
> I hope you can see where I am and throw me a rope!
> Ray Russell
> General Contractor
> Norfolk & Western Railroad
>
> Pocahontas Division
> Circa 1958
> Visit The Pocahontas Website at:
> <A
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
> Surf the web and try one of the many starter projects. Just breadboard the
> circuit and use the sampe code verbatim to learn how it all works. Then
Did the original poster say they had Myke Predko's book? (or was that
some other post...hmm) There are several example projects in there
(including a blinking LED and pushbutton activated LED, I think) and I
will have to concur on the suggestion that you start small.
I got started with a YAP-II and Myke's book; you can certainly start
cheaper if you need to. I was happy with the YAP-II programmer /
breadboard and the easy windows-based interface.
You said you were unsure where to start (ie compiling, etc) -- Download
the MPASM assembler / utilities from Microchips web site, and install it.
Get some sort of programmer ready, and try to assemble something and then
upload it to the PIC.
> reprogrammed that sucker a jillion times, adding just a few instructions
1 jillion programming cycles is well out of spec, I'm afraid :)
>I have gotten several posts from this list but they all figure I know how
to use the compiler and know
>how to write code. I am so lost I wanna dump the whole thing but everyone
keeps telling me it is so
>simple!
It's only simple if you know what you're doing. The project that you wish
to do is in itself simple but you have to learn the basics of the Pics in
order to do it. That is not simple and can't be done in a few minutes.
At 02:41 AM 2/14/01 -0500, Ray Russell wrote:
>David,
>Thanks for your very quick reply!
>While I understand the theory, putting what you are saying to use has left me
>out in the cold!
>Do you have a program that would do all this that you could add notes to that
>tell me what each line is doing? This way I could go to the data sheet and
>actually figure out what is going on? This way I am not burning up hours
>beating my head against the wall.
Unfortuntely no. I don't write a lot of PIC code, and what I do, belongs to
my customers.
You need to set up seven pins as one group of outputs for the segments. I
would try to make that all
on one port. Look at the TRIS register to do that.
You also need three more output pins for the digits, again the TRIS
register. It won't matter much which port they are on. For simplicity, I'd
put them on another port.
Now you have Port X, bits 0-6 as segments, and Port Y bits 0-2 as digits.
This part depends on your display:
Some are "common cathode", and want the digit low, and segments high.
Others are "common anode", and want the digit high, and segments low.
Either way, if you output 11110000 to port X (Look at the port registers),
and output 010 to port Y, then you'll be able to figure out which sort of
display you have, and how to drive it.
I wouldn't advise you to start out with a C compiler.
Assembler is the way to talk directly to the machine.
Your first program will look something like this:
Start:
movlw $00 ;
movwf trisX ;Make all of port X, outputs
movwf trisy ;and port y
movlw $F0
movwf portx ;Set up the segment pattern
movlw $02
movwf porty ;Set up the digit pattern
> Ray,
>
> Start your PIC journey by reading
>
> http://www.piclist.com/techref/microchip/intro/pic.htm
>
> Start really simple. DO NOT attempt to write the train speed controller
> until you are really happy with the writing , assembling and programming of
> your code.
>
>
To ALL,
Thank you all for all your responses! It is going to take me a couple of days
to wade through all the stuff I got! I will repost with any further questions
as they come up. This list is great!
Ray Russell
General Contractor
Norfolk & Western Railroad
When I first started I used the Bernard Babini Book 'Introduction to the PIC micro
controller'
It gets you flashing and LED and then continues. It was very inexpensive but
invaluable.
> At 02:41 AM 2/14/01 -0500, Ray Russell wrote:
> >David,
> >Thanks for your very quick reply!
> >While I understand the theory, putting what you are saying to use has left me
> >out in the cold!
> >Do you have a program that would do all this that you could add notes to that
> >tell me what each line is doing? This way I could go to the data sheet and
> >actually figure out what is going on? This way I am not burning up hours
> >beating my head against the wall.
>
> Unfortuntely no. I don't write a lot of PIC code, and what I do, belongs to
> my customers.
>
> You need to set up seven pins as one group of outputs for the segments. I
> would try to make that all
> on one port. Look at the TRIS register to do that.
> You also need three more output pins for the digits, again the TRIS
> register. It won't matter much which port they are on. For simplicity, I'd
> put them on another port.
>
> Now you have Port X, bits 0-6 as segments, and Port Y bits 0-2 as digits.
>
> This part depends on your display:
> Some are "common cathode", and want the digit low, and segments high.
> Others are "common anode", and want the digit high, and segments low.
>
> Either way, if you output 11110000 to port X (Look at the port registers),
> and output 010 to port Y, then you'll be able to figure out which sort of
> display you have, and how to drive it.
>
> I wouldn't advise you to start out with a C compiler.
> Assembler is the way to talk directly to the machine.
>
> Your first program will look something like this:
>
> Start:
> movlw $00 ;
> movwf trisX ;Make all of port X, outputs
> movwf trisy ;and port y
>
> movlw $F0
> movwf portx ;Set up the segment pattern
> movlw $02
> movwf porty ;Set up the digit pattern
>
> Here: goto Here ;Just hang here in a loop
>
> --
> Dave's Engineering Page: http://www.dvanhorn.org
> Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
>
> --
> http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> email listservSTOPspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body
--
Information in this communication and any attachments are confidential,
and may not be copied or used by anyone other than the addressee, nor
disclosed to any third party without our permission. If you have received
this communication in error, please notify the sender immediately and then
destroy any copies of it. There is no intention to create any legally
binding contract or other commitment through the use of this email.
One thing that ALL of us forgot to mention when telling you to start simple
is that this is still very fun and exciting.
You'd be amazed at how silly otherwise grownup adults can be when they get
an LED to blink for the first time. We'll jump up and down and holler
hoo-rahs for having conquered the machine. To anyone else, it's just a
stupid blinking LED, but the satisfaction of getting that to work can't be
overstated.
I remember when I was a little further along on my thermostat project. I'd
been working for days and had finally gotten my PIC to 'talk' to my
temperature sender, convert the data, and send it to be displayed on several
7-segment LEDs. I have the temperature probe on this 5 foot cable, stuck in
the refrigerator door, when my sister walked by. I was so excited that it
was all working that I showed it off to her.
Her response? "Congratulations, Matthew. You've invented the thermometer."
And she walked off.
I agree that the blinking LED should be among the first projects. You
just make more complicated stuff from there. Even simpler than a blinking
LED, however, would be to just do something like:
bank1 ; macro to switch to bank 1
clrf trisb
bank0
loop
incf portb,1
goto loop
Look at each of the portb lines with a scope. You should see a square
wave on RB0, half that frequency on RB1, etc. down to RB7.
One problem with the blinking LED program is people might not know it's
working because the LED blinks so fast (they didn't put in a delay
routine or miscalculated the delay). A scope lets you see what's going
on, even if it's fast...
> Hey Ray--
>
> One thing that ALL of us forgot to mention when telling you to start
> simple
> is that this is still very fun and exciting.
>
> You'd be amazed at how silly otherwise grownup adults can be when
> they get
> an LED to blink for the first time. We'll jump up and down and
> holler
> hoo-rahs for having conquered the machine. To anyone else, it's
> just a
> stupid blinking LED, but the satisfaction of getting that to work
> can't be
> overstated.
>
> I remember when I was a little further along on my thermostat
> project. I'd
> been working for days and had finally gotten my PIC to 'talk' to my
> temperature sender, convert the data, and send it to be displayed on
> several
> 7-segment LEDs. I have the temperature probe on this 5 foot cable,
> stuck in
> the refrigerator door, when my sister walked by. I was so excited
> that it
> was all working that I showed it off to her.
>
> Her response? "Congratulations, Matthew. You've invented the
> thermometer."
> And she walked off.
>
> Ah well.
>
> -Matt
>
just to add my 2 cents, at the very beginning its nice to
have a little 5volt piezo from radioshack. often your ear can
hear faster than your eye can see, and the piezo and a bit of
wire allows you to see if the oscillator on the chip is
working (a soft buzz), if a pin is firing too fast to see
the led ( a tiny click) and whether a pin is high or low.
the book Easy Pic'n is a really good start, and it starts
with a good hookup diagaram.
> In a message dated 2/14/01 3:08:59 AM Eastern Standard Time,
> EraseMEext-peter.bettsEraseMENOKIA.COM writes:
>
>
> > Ray,
> >
> > Start your PIC journey by reading
> >
> > www.piclist.com/techref/microchip/intro/pic.htm
> >
> > Start really simple. DO NOT attempt to write the train speed controller
> > until you are really happy with the writing , assembling and programming of
> > your code.
> >
> >
>
> To ALL,
> Thank you all for all your responses! It is going to take me a couple of days
> to wade through all the stuff I got! I will repost with any further questions
> as they come up. This list is great!
> Ray Russell
> General Contractor
> Norfolk & Western Railroad
>
> Pocahontas Division
> Circa 1958
> Visit The Pocahontas Website at:
> <A HREF="http://milliron.home.sprynet.com/Pocahontas/Pocahontas1.htm">Click here: Pocahontas Home
Having just read your email, I get the urge to try to give you exactly what
you asked for. But then reality sets in: it is mid-week, at work, have
plenty on my plate already AND what good would it really do you? Rather than
starting with the finished product, I feel you should try to get used to the
tools and the technology first - then add to it as you become more capable.
We'd all be happy to help, and it makes it easier on us (and you) if it is
done incrementally.
On the old/dumb point:
I am fascinated by technology. I really get off learning how something works
or how some difficult problem was solved.
But at the same time I frequently get depressed when I see how quickly
someone else created a mountain of code and/or complex circuitry compared to
what I think I could have accomplished in the same timeframe.
I end up feeling dumb/slow, etc...
But I have two things going for me: curiosity and tenacity. As I said, I
really enjoy learning the 'how' AND once I sink my teeth into something I
will pour it on until either it works or I've learned enough to change the
approach.
So, while compared to many on this list I'd probably rate as a "mental
midget," I still manage to be productive enough for my needs and the needs
of my employer.
Bottom line, if I can do it so can you. It just takes interest (curiosity)
and desire&determination (tenacity)!
I 100% agree with the many posts pointing out that you should start small.
Get the old blinking LED working. Then move on to bigger stuff as you gain
confidence.
In fact this is how most of the projects I work on are done, broken down
into smaller/simpler & more manageable pieces. When you get the pieces
working independently then you try to bring them together in sections. This
greatly simplifies debugging - if you _KNOW_ the pieces worked separately
then you can focus on the interactions between them to figure out what is
wrong (or what broke what).
A simple thing like an LED on an output can also help with debugging as it
can let you know where in code it is. You could flash certain patterns/rates
(or just flash period!), etc. It is amazing how much something like this can
help when dealing with this stuff - especially when you don't have an in
circuit debugger/emulator and therefore almost no idea what is currently
happening inside the chip when it isn't working.
I didn't see any mention in your post about a programmer (or downloader) for
your device. I am using PIC16F876 and PIC16F877 that can be programmed (in
circuit - like your 'F84!) with a simple programmer I built with Radio Shack
parts from a design off the web. (Also occasionally use the older PIC16C71).
Most of the PIC16F87x programmers are actually designs used for the
PIC16F84, so you should be able to make your own if you don't/can't purchase
one.
Unless you are using a Microchip programmer, you will probably need to
obtain software to download the assembled code from MPLAB into the device.
There are several freely available - many authored by piclist members.
Also I picked up Microchips ICD for the PIC16F87x family, it integrates into
MPLAB allowing you to
code/assemble/program/debug/code/assemble/program/debug... all within the
MPLAB (moves from the simulator to your circuit - check program flow,
register contents, can even read/write i/o pins directly!). You can get it
from DIGI-KEY for $99 or buy a version from Professor Anderson for $89 (his
version does not come with samples whereas the others come with one 'F877
and one 'F876). Though Prof. Andersons comes with an adapter that you'll
need to purchase seperately (from Radio Shack, etc.) if you choose
Microchips/Digi-keys version (to go from 6 pin modular plug to screw
terminals to connect to your device).
Look here: http://www.digikey.com
search2.microchip.com/icdpromo/index.htm http://www.phanderson.com/icd/index.html
Keep the faith and keep posting as you try different things. We're all
mortal.
Unfortunately many beginners don't have a scope - but they usually do have
or can easily get an LED.
Many of the best beginner projects need nothing more than a multimeter to
test run and fix... But when someone invents the 20MHz oscilliscope that
only costs $50 the world of hobby electronics will balloon.
>
> I agree that the blinking LED should be among the first projects. You
> just make more complicated stuff from there. Even simpler than a blinking
> LED, however, would be to just do something like:
>
> bank1 ; macro to switch to bank 1
> clrf trisb
> bank0
> loop
> incf portb,1
> goto loop
>
> Look at each of the portb lines with a scope. You should see a square
> wave on RB0, half that frequency on RB1, etc. down to RB7.
> One problem with the blinking LED program is people might not know it's
> working because the LED blinks so fast (they didn't put in a delay
> routine or miscalculated the delay). A scope lets you see what's going
> on, even if it's fast...
>
> Harold
>
> On Wed, 14 Feb 2001 11:14:50 -0600 Matthew Mucker <TakeThisOuTmmucker.....TakeThisOuTAIRMAIL.NET>
> writes:
> > Hey Ray--
> >
> > One thing that ALL of us forgot to mention when telling you to start
> > simple
> > is that this is still very fun and exciting.
> >
> > You'd be amazed at how silly otherwise grownup adults can be when
> > they get
> > an LED to blink for the first time. We'll jump up and down and
> > holler
> > hoo-rahs for having conquered the machine. To anyone else, it's
> > just a
> > stupid blinking LED, but the satisfaction of getting that to work
> > can't be
> > overstated.
> >
> > I remember when I was a little further along on my thermostat
> > project. I'd
> > been working for days and had finally gotten my PIC to 'talk' to my
> > temperature sender, convert the data, and send it to be displayed on
> > several
> > 7-segment LEDs. I have the temperature probe on this 5 foot cable,
> > stuck in
> > the refrigerator door, when my sister walked by. I was so excited
> > that it
> > was all working that I showed it off to her.
> >
> > Her response? "Congratulations, Matthew. You've invented the
> > thermometer."
> > And she walked off.
> >
> > Ah well.
> >
> > -Matt
> >
> Unfortunately many beginners don't have a scope - but they usually do have
> or can easily get an LED.
>
> Many of the best beginner projects need nothing more than a multimeter to
> test run and fix... But when someone invents the 20MHz oscilliscope that
> only costs $50 the world of hobby electronics will balloon.
>
> -Adam
>
>
This I have !
While I am totaly uneducated when it comes to PICS I have a lot of use in the
auto motive field these days!
Ray Russell
General Contractor
Norfolk & Western Railroad
> Hey Ray--
>
> One thing that ALL of us forgot to mention when telling you to start
simple
> is that this is still very fun and exciting.
>
> You'd be amazed at how silly otherwise grownup adults can be when they get
> an LED to blink for the first time. We'll jump up and down and holler
> hoo-rahs for having conquered the machine. To anyone else, it's just a
> stupid blinking LED, but the satisfaction of getting that to work can't be
> overstated.
>
> I remember when I was a little further along on my thermostat project.
I'd
> been working for days and had finally gotten my PIC to 'talk' to my
> temperature sender, convert the data, and send it to be displayed on
several
> 7-segment LEDs. I have the temperature probe on this 5 foot cable, stuck
in
> the refrigerator door, when my sister walked by. I was so excited that it
> was all working that I showed it off to her.
>
> Her response? "Congratulations, Matthew. You've invented the
thermometer."
> And she walked off.
>
> Ah well.
>
> -Matt
>
So True
With an observation like that you must be a psychologist
or a comedian
Ray Russell wrote:
>
> I have asked for some help on this list recently. I am trying to learn enough
> of both the hardware and software needed to accomplish my first project. I am
I learned how to program the 16c84 from a tutorial which came on the March,
April and May '98 editions of Everyday Practical Electronics
(http://www.epemag.wimborne.co.uk). The 3 part tutorial starts by giving you
detailed instructions on how to build a programmer for the PIC and then
takes you from programming flashing leds to driving 8x segment displays and
also LCD's. You might be able to get back copies of the magazine, and they
also have all of their tutorial program code on their ftp server, under 'PIC
Tutor'. I can highly recomend it. You can finish the tutorial in about a
week if you're persistent and try out all the execises.
Just a note though, the tutorial teaches TASM which is a kind of dialect of
MPASM. The differences are not huge and it's easy do change from one to the
other. Also, the writers of the tutorial also wrote a program which converts
TASM to MPASM files and vice versa.
> > 7-segment LEDs. I have the temperature probe on this 5 foot cable, stuck
> in
> > the refrigerator door, when my sister walked by. I was so excited that it
> > was all working that I showed it off to her.
> >
> > Her response? "Congratulations, Matthew. You've invented the
> thermometer."
> > And she walked off.
> >
> > Ah well.
Yah... I know what you mean. I had mine talking to a Dallas temp sensor
and displaying the temperature (C and F alternating) on an LCD, with
occasional "inspirational" messages thrown in. Had it in my cube at
work... now, mind you, I work with UNIX geeks, NT geeks and network geeks
(I'm two and a half of these). All are convinced I'm some kind of weirdo,
with two exceptions.
When a hundred geeks think YOU'RE the geek, you know you're a geek.
Dale
---
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
-- Isaac Asimov
I am very impressed with how so many people can do so much with so
little. A scope is very valuable, but it IS possible to get stuff working
without it. You're often in the dark, but it CAN be done.
Every monring when I get to work, I turn on my computer, the scope, then
the coffee. The scope is well used...
> Unfortunately many beginners don't have a scope - but they usually do
> have
> or can easily get an LED.
>
> Many of the best beginner projects need nothing more than a
> multimeter to
> test run and fix... But when someone invents the 20MHz oscilliscope
> that
> only costs $50 the world of hobby electronics will balloon.
>
> -Adam
>
> Harold M Hallikainen wrote:
> >
> > I agree that the blinking LED should be among the first
> projects. You
> > just make more complicated stuff from there. Even simpler than a
> blinking
> > LED, however, would be to just do something like:
> >
> > bank1 ; macro to switch to bank 1
> > clrf trisb
> > bank0
> > loop
> > incf portb,1
> > goto loop
> >
> > Look at each of the portb lines with a scope. You should
> see a square
> > wave on RB0, half that frequency on RB1, etc. down to RB7.
> > One problem with the blinking LED program is people might
> not know it's
> > working because the LED blinks so fast (they didn't put in a delay
> > routine or miscalculated the delay). A scope lets you see what's
> going
> > on, even if it's fast...
> >
> > Harold
> >
> > On Wed, 14 Feb 2001 11:14:50 -0600 Matthew Mucker
> <mmuckerspamBeGoneAIRMAIL.NET>
> > writes:
> > > Hey Ray--
> > >
> > > One thing that ALL of us forgot to mention when telling you to
> start
> > > simple
> > > is that this is still very fun and exciting.
> > >
> > > You'd be amazed at how silly otherwise grownup adults can be
> when
> > > they get
> > > an LED to blink for the first time. We'll jump up and down and
> > > holler
> > > hoo-rahs for having conquered the machine. To anyone else, it's
> > > just a
> > > stupid blinking LED, but the satisfaction of getting that to
> work
> > > can't be
> > > overstated.
> > >
> > > I remember when I was a little further along on my thermostat
> > > project. I'd
> > > been working for days and had finally gotten my PIC to 'talk' to
> my
> > > temperature sender, convert the data, and send it to be
> displayed on
> > > several
> > > 7-segment LEDs. I have the temperature probe on this 5 foot
> cable,
> > > stuck in
> > > the refrigerator door, when my sister walked by. I was so
> excited
> > > that it
> > > was all working that I showed it off to her.
> > >
> > > Her response? "Congratulations, Matthew. You've invented the
> > > thermometer."
> > > And she walked off.
> > >
> > > Ah well.
> > >
> > > -Matt
> > >
At 07:18 AM 2/15/01 -0800, Harold M Hallikainen wrote:
> I am very impressed with how so many people can do so much with so
>little. A scope is very valuable, but it IS possible to get stuff working
>without it. You're often in the dark, but it CAN be done.
> Every monring when I get to work, I turn on my computer, the
> scope, then
>the coffee. The scope is well used...
Way back when, (When I didn't have a scope) I built a 555 circuit that
would stretch any pulse to 1S, which fired a beeper.
Later, I built a "logic analyzer" with an HC688(?) magitude comparator. 8
dipswitches, and 8 probes. It would trip the beeper if a given state occurred.
Got a lot of debug out of that.
Then there was the rig that used two 8 bit DACs to display the current
address plot of a running processor on a scope :)
----- Original Message -----
From: David VanHorn <.....dvanhorn@spam@EraseMECEDAR.NET>
> Then there was the rig that used two 8 bit DACs to display the current
> address plot of a running processor on a scope :)
Ok, it definitely wakes you up to the fact that your code is spending a lot
of time in a loop.. Service guys used it for a while with a "glomper" clip
to troubleshoot dead systems by seeing where the code was working. One of
them made up an overlay for the scope that said which chips to replace if
the bright part was in specific zones.. :)
I am very impressed with how so many people can do so much with so
little. A scope is very valuable, but it IS possible to get stuff working
without it. You're often in the dark, but it CAN be done.
Every monring when I get to work, I turn on my computer, the scope,
then
the coffee. The scope is well used...
> Unfortunately many beginners don't have a scope - but they usually do
> have
> or can easily get an LED.
>
> Many of the best beginner projects need nothing more than a
> multimeter to
> test run and fix... But when someone invents the 20MHz oscilliscope
> that
> only costs $50 the world of hobby electronics will balloon.
>
> -Adam
>
> Harold M Hallikainen wrote:
> >
> > I agree that the blinking LED should be among the first
> projects. You
> > just make more complicated stuff from there. Even simpler than a
> blinking
> > LED, however, would be to just do something like:
> >
> > bank1 ; macro to switch to bank 1
> > clrf trisb
> > bank0
> > loop
> > incf portb,1
> > goto loop
> >
> > Look at each of the portb lines with a scope. You should
> see a square
> > wave on RB0, half that frequency on RB1, etc. down to RB7.
> > One problem with the blinking LED program is people might
> not know it's
> > working because the LED blinks so fast (they didn't put in a delay
> > routine or miscalculated the delay). A scope lets you see what's
> going
> > on, even if it's fast...
> >
> > Harold
> >
> > On Wed, 14 Feb 2001 11:14:50 -0600 Matthew Mucker
> <spamBeGonemmucker@spam@AIRMAIL.NET>
> > writes:
> > > Hey Ray--
> > >
> > > One thing that ALL of us forgot to mention when telling you to
> start
> > > simple
> > > is that this is still very fun and exciting.
> > >
> > > You'd be amazed at how silly otherwise grownup adults can be
> when
> > > they get
> > > an LED to blink for the first time. We'll jump up and down and
> > > holler
> > > hoo-rahs for having conquered the machine. To anyone else, it's
> > > just a
> > > stupid blinking LED, but the satisfaction of getting that to
> work
> > > can't be
> > > overstated.
> > >
> > > I remember when I was a little further along on my thermostat
> > > project. I'd
> > > been working for days and had finally gotten my PIC to 'talk' to
> my
> > > temperature sender, convert the data, and send it to be
> displayed on
> > > several
> > > 7-segment LEDs. I have the temperature probe on this 5 foot
> cable,
> > > stuck in
> > > the refrigerator door, when my sister walked by. I was so
> excited
> > > that it
> > > was all working that I showed it off to her.
> > >
> > > Her response? "Congratulations, Matthew. You've invented the
> > > thermometer."
> > > And she walked off.
> > >
> > > Ah well.
> > >
> > > -Matt
> > >
Peter,
Since this is a hobby project no onwill be injured if your code is wrong.
That is of course if you do not count the hours I spend trying to figure out
what I did wrong! 8>)
Ray Russell
General Contractor
Norfolk & Western Railroad
> -----Original Message-----
> From: James Newton [SMTP:spamBeGonejamesnewtonspam_OUTRemoveMEPICLIST.COM]
> Sent: Thursday, February 15, 2001 7:00 PM
> To: .....PICLISTRemoveMEMITVMA.MIT.EDU
> Subject: Re: [OT:] 16F84 first project "Mentor Needed" "Thanks!"
>
> Harold, your morning routine is hazardous...
> ...coffee, THEN computer then scope.
>
> James Newton, PICList Admin #3
> jamesnewton@spam@piclist.com
> 1-619-652-0593 phone
> http://www.piclist.com
>
> ----- Original Message -----
> From: Harold M Hallikainen <EraseMEharoldhallikainenRemoveMESTOPspamJUNO.COM>
> To: <RemoveMEPICLISTKILLspamTakeThisOuTMITVMA.MIT.EDU>
> Sent: Thursday, February 15, 2001 07:18
> Subject: Re: [PICLIST] 16F84 first project "Mentor Needed" "Thanks!"
>
>
> I am very impressed with how so many people can do so much with so
> little. A scope is very valuable, but it IS possible to get stuff working
> without it. You're often in the dark, but it CAN be done.
> Every monring when I get to work, I turn on my computer, the
> scope,
> then
> the coffee. The scope is well used...
>
> Harold
>
>
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
> Yapp ! It's probably the best support for your coffe cup !
>Until you drop it inside...
>[just a joke]
>Vasile
It is a bit like the call to the PC service centre made by a woman who
complained the coffee cup holder on her PC was faulty. The tech told her the PC
did not come with a cup holder, but she insisted. Eventually he asked her what
was written on the front of the cup holder, to which she replied "CD 40X".
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
> > Yapp ! It's probably the best support for your coffe cup !
> >Until you drop it inside...
> >[just a joke]
> >Vasile
>
> It is a bit like the call to the PC service centre made by a woman who
> complained the coffee cup holder on her PC was faulty. The tech told her
the PC
> did not come with a cup holder, but she insisted. Eventually he asked her
what
> was written on the front of the cup holder, to which she replied "CD 40X".
This one is so old it started with CD 1X
Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads