Serial Port + BS2p40
CRussell
Posts: 15
Rather a simplistic question I hope.· I know the BS2p40 is programmed via the serial port using pins 1-4 on the chip.· I'm intending on making a project to control certain circuits external to the chip and was planning on controlling the BS2 via the serial port from the computer it's connected to.· I'll be playing with the SERIN/SEROUT commands in order to communicate with it.· The question is, do I need to attach a secondary serial port to the chip for this communication, or can I use the already attached serial port on pins 1-4 for those communications?· If I indeed need to add a secondary port, is it the same wiring diagram as for the already attached serial port?· IE an SOUT/SIN and ATN line on pins 2,3,4 (on the DB9) respectively to 3 seperate pins on the BS2?· Also, do I need to include the 0.1uF caps as shown in the parallax diagram for hooking up said serial port?· Thanks in advance.
Comments
2. If you DO decide to add a second port, you'll need a MAX232 or equivalent chip to generate the +-9 volt signal the PC needs out of the 0..+5 volt signal the BS2 uses. So pins 2 and 3 on the DB-9 would go to the Max232, and the other side of the Max232 would go to two pins on the BS2. You MUST connect pin 5 (ground) of the DB-9 to Vss as well.
3. The "ATN" signal is ONLY used for programming purposes -- it allows the IDE to "reset" the BS2 for programming, and that ONLY works on the "programming" port. The 0.1 uF caps "decouple" the ATN signal so that 'dumb' programs like Hyperterm (which hold ATN in "reset" otherwise) will still let the BS2 run. So for a 'normal' serial port, you don't need these capacitors.
SERIN and SEROUT can be used on this port with a "pin" number of 16.