Searching \ for '[PIC]: 16F84 help needed.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: '16F84 help needed.'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 16F84 help needed.'
2001\01\22@032618 by Roman Black

flavicon
face
Ray Russell wrote:
>
> I am a rank begginer here so please help if you can.
> I have a project I need to do for my main hobby interest Model Railroading.
> I would like to build a speedometer for a section of track at the club.
> I have detetcors already installed that light an LED when a train passes it.
> I figure I can space 2 of these a specified distance apart and use the
> outputs of the detectors to tell the PIC to start counting and stop counting.
> Then let it do the math and display it on 2 Seven segment LED's.
> I have the chip/programer and enough hardware to power the chip. I also have
> the LED's.
> This is where I fall on my face. I have looked for a couple of days now for
> code to drive the LED's and a schematic on how to hook them up.
> I know this is asking alot since I am only a beginner here but you got to
> start somewhere!


Hi Ray, good luck with your project. Be patient and split
it into simple system modules, 16F84 is good for that as
you can quickly reprogram and test/refine each little code
module.

The http://www.microchip.com site has some app notes on connecting
a PIC to multiple 7-seg displays. It's really not hard
electronics wise, but for the code you will need to multiplex,
ie, display each of the two numbers in turn. You might find
this a bit tricky but it's not hard really. Get each display
working separately, then work on the mutliplexing later!

If you are only timing to 2 digits resolution, you should
be able to use a simple timer0 counter, which you reset at
the first sensor and read the counter result at the second
sensor. Only gets tricky if you want exact scale MPH or
whatever, you will need to do calcs, sometimes tricky
on a PIC.

Exactly what level of skill do you have re electronics/pic
coding?
:o)
-Roman

PS. I have tagged this [PIC]: to make the list happy.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\22@090528 by Olin Lathrop

face picon face
Strange, I never saw this post directly, only in Roman's response to it.

> I have a project I need to do for my main hobby interest Model
Railroading.
> I would like to build a speedometer for a section of track at the club.
> I have detetcors already installed that light an LED when a train passes
it.
> I figure I can space 2 of these a specified distance apart and use the
> outputs of the detectors to tell the PIC to start counting and stop
counting.
> Then let it do the math and display it on 2 Seven segment LED's.
> I have the chip/programer and enough hardware to power the chip. I also
have
> the LED's.
> This is where I fall on my face. I have looked for a couple of days now
for
> code to drive the LED's and a schematic on how to hook them up.
> I know this is asking alot since I am only a beginner here but you got to
> start somewhere!

This sounds like a great beginner project.

To measure the speed, you measure the time between the pulses and invert to
get the speed.  Of course there is a constant in there to convert to
furlongs/fortnight, rods/minute, or whatever speed units you want.  There
are lots of ways to measure time between pulses.  If you use a 16F876 (nice
chip to learn on), you could reset timer 1 on the first pulse and read the
value on the second.  There are more sophisticated ways, but for your
problem and expected time interval (50 to 500 mS?) that should be fine.

The conversion from time to speed will require a divide.  There are lots of
fixed point divide routines around.  Check the PIClist archives and the
Microchip app notes.

Driving the 7 segment displays will require a table.  Since you only want to
display 10 different digits, put the output bit pattern that produces each
digit as one entry of a table.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\23@031656 by Roman Black

flavicon
face
RRuss45826@aol.com wrote:
{Quote hidden}

Hi Ray, if you have built other projects it shouldn't
be too hard. Did you check Microchip for any 7-seg
app notes?? Sometimes it's hard to navigate their site
but well worth getting used to finding things there.

Also, you emailed this to me direct, not the list.
I have sent it back to the list. :o)

If you are not using MPLAB I suggest you start, you
can use it to simulate your code pieces, and it is
handy for checking register and ram contents when you
are first getting used to the PIC instuction set.
With PIC newbies I always suggest printing the whole
datasheet for that PIC, putting in a folder and writing
notes all through it as you learn the ports and timers
and stuff. Also print the instruction set page and
put it on the wall or side of your monitor. :o)

Good luck!
-Roman

PS. I think the list has been playing up, some days
lately I have only received a few list emails. There
might be a number of members who haven't seen your
question??

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...