This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C09D0C.6DCB53E0 Content-Type: text/plain; charset="iso-8859-1" Mentor - 16f84 speedo Part 1A: (my apologies if you've recieved duplicates of this) Below is a copy of a letter I just sent to Ray, an aspiring PIC enthusiast (you may have read his posts from a week ago regarding a request for assistance with his 'f84 project). I did a quick "back of the napkin" sketch of a circuit that would allow him to begin to build his project. But I have never worked with the 'f84 and am only recently getting back up to speed with the pics in general: So _Please_ feel free to review and contribute! Details: His project is a speedometer for a model train set. He wants to have the trains speed measured (at at least one point) and displayed on a pair of 7-segment LEDs, all controlled by a Pic16f84. Note that this is also meant as a project for him to be introduced with the Pic family. He has constructed a working pair of opto sensors to detect the passing train and has enough working knowledge about electronics to appreciate some of the subtleties involved (he mentioned that he may place opto's inline to eliminate problems with ground loops). He has little/no experience with the pic (or uC/uP in general??) so he will need assistance from the ground up in that area. He reads the piclist and will get any posts you make, though you may want to respond to this one or set the subject appropriately - to ensure it attracts his attention. Thanks in advance for your thoughts. Bruce. --My letter to Russ follows--------------------------------------------- Ray: Attached (also pasted below) is a first drawing for the speedometer project. PLEASE Note that this is just a first sketch, I still have to look at the PIC16f84 specs (I've NEVER worked with this part), so things may change. I'd appreciate it if you'd double check pins for me. Feel free to get a second opinion on this, pass it around friends and the piclist (I may even do this)... it is meant as a starting place - though it is simple enough that it should be workable as is. The fact that you've already made reliable sensors will be a significant help. The code has yet to be developed. I will start looking at this over the next few days/week - if anyone else provides you code and/or a better circuit before then I will not be offended. Most of the pins I chose were completely arbitrary, except for the first sensors pin - RB0 - which the pinout for the Pic16f84a shows as RB0/INT (if this is the only interrupt input, then I figured we should trigger off of this from the first sensor and count how long it takes for the second sensor to be blocked...). Feel free to begin to get your parts together and build the circuit, but I would strongly urge you to use a solderless breadboard (about $13.00 at Radio Shack, etc.). Do you have Microchips PDF for the Pic16f84a? If not I'll email that to you as well. Talk soon. Bruce. +5V +5V --- --- | | > | < |14 R1 > ----------------- < | Vdd | > | | < | |18 | | RA1|---------< From 2nd Sensor | | | | 4| |6 +--------|/MCLR PIC RB0|---------< From 1st Sensor ------------------- ------------------- | | 16F84 | | | | | | | |13 14| | 14| | | | RB7|---------------------^v^v^v-----------|a |-----------------|a | --- | | 330 ohms | Common Cathode | | Common Cathode | C1 --- | |12 13| 7 Segment | 13| 7 Segment | | | RB6|---------------------^v^v^v-----------|b LED Display |-----------------|b LED Display | | | | 330 ohms | | | | --- | |11 8| | 8| | Gnd | RB5|---------------------^v^v^v-----------|c Left Digit |-----------------|c Right Digit | | | 330 ohms | | | | | |10 7| | 7| | | RB4|---------------------^v^v^v-----------|d |-----------------|d | | | 330 ohms | | | | 16| |9 6| LED1 | 6| LED2 | +--------|OSC1 RB3|---------------------^v^v^v-----------|e |-----------------|e | | | | 330 ohms | | | | | | |8 1| | 1| | 4 MHZ --- | RB2|---------------------^v^v^v-----------|f |-----------------|f | ------- | | 330 ohms | | | | XTAL1 ------- | |7 2| | 2| | --- | RB1|---------------------^v^v^v-----------|g |-----------------|g | | | | 330 ohms | | | | | 15| |17 | cathode | | cathode | +--------|OSC2 RA0|-------+ ------------------- ------------------- | | | | 4 | 4 | Vss | | | | ----------------- | | | |5 | | | | | | | | | | | --- | | | Gnd | | | | | | | *------+ | | | | | | | | | | | | | | Q1 / | Q2 / +5V +5V +5V | |/ | |/ --- --- --- +------------------------^v^v^v-------| +--------------^v^v^v-------| | | | 10K ohms |\ 10K ohms |\ | | | \ \ | | | v v --- --- --- | All Resistors 1/4 Watt | 0.1 --- 0.1 --- 0.1 --- | | uF | uF | uF | | | | | | | Q1, Q2: Small Signal | | | | --- Switching Transistors --- --- --- --- Gnd Typ: 2n3904 / 2n2222 Gnd Gnd Gnd Gnd Page 1: Pic and LED Display Rev 1.0, 2-22-2001 <> ------_=_NextPart_000_01C09D0C.6DCB53E0 Content-Type: text/plain; name="Pic84-Russ pp1.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Pic84-Russ pp1.txt" = =20 +5V +5V = =20 --- --- = =20 | | = =20 > | = =20 < |14 = =20 R1 > ----------------- = =20 < | Vdd | = =20 > | | = =20 < | |18 = =20 | | RA1|---------< From 2nd Sensor = =20 | | | = =20 | 4| |6 = =20 +--------|/MCLR PIC RB0|---------< From 1st Sensor = ------------------- -------------------=20 | | 16F84 | = | | | | | | |13 = 14| | 14| | | | = RB7|---------------------^v^v^v-----------|a = |-----------------|a | --- | | 330 ohms = | Common Cathode | | Common Cathode | C1 --- | |12 = 13| 7 Segment | 13| 7 Segment | | | = RB6|---------------------^v^v^v-----------|b LED Display = |-----------------|b LED Display | | | | 330 ohms = | | | | --- | |11 = 8| | 8| | Gnd | = RB5|---------------------^v^v^v-----------|c Left Digit = |-----------------|c Right Digit | | | 330 ohms = | | | | | |10 = 7| | 7| | | = RB4|---------------------^v^v^v-----------|d = |-----------------|d | | | 330 ohms = | | | | 16| |9 = 6| LED1 | 6| LED2 | +--------|OSC1 = RB3|---------------------^v^v^v-----------|e = |-----------------|e | | | | 330 ohms = | | | | | | |8 = 1| | 1| | 4 MHZ --- | = RB2|---------------------^v^v^v-----------|f = |-----------------|f | ------- | | 330 ohms = | | | | XTAL1 ------- | |7 = 2| | 2| | --- | = RB1|---------------------^v^v^v-----------|g = |-----------------|g | | | | 330 ohms = | | | | | 15| |17 = | cathode | | cathode | +--------|OSC2 RA0|-------+ = ------------------- -------------------=20 | | | = | 4 | 4 =20 | Vss | | = | | =20 ----------------- | = | | =20 |5 | = | | =20 | | = | | =20 | | = | | =20 --- | = | | =20 Gnd | = | | =20 | = | | =20 | = *------+ | =20 | = | | | =20 | = | | | =20 | = | | | =20 | = Q1 / | Q2 / =20 +5V +5V +5V | = |/ | |/ =20 --- --- --- = +------------------------^v^v^v-------| = +--------------^v^v^v-------| =20 | | | = 10K ohms |\ 10K ohms |\ =20 | | | = \ \ =20 | | | = v v =20 --- --- --- = | All Resistors 1/4 Watt | =20 0.1 --- 0.1 --- 0.1 --- = | | =20 uF | uF | uF | = | | =20 | | | = | Q1, Q2: Small Signal | =20 | | | = --- Switching Transistors --- =20 --- --- --- = Gnd Typ: 2n3904 / 2n2222 Gnd =20 Gnd Gnd Gnd = =20 = =20 = Page 1: Pic and LED Display =20 = Rev 1.0, 2-22-2001 =20 ------_=_NextPart_000_01C09D0C.6DCB53E0-- -- 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