Dennis,
A few thoughts on linking PICs by RS232:
1. I've done it - unfortunately, deleted the code after getting it working.
2. I used SERIN2 and SEROUT2, by habit rather than for good technical reasons.
3. HSEROUT/HSERIN do pass much of the processing down to the chip hardware and save lots of processing time and code space. However, if you are still in the 'getting something working stage' I'd use SEROUT/SERIN to avoid additional DEFINES and so on needed for HSEROUT/IN.
4. I've had a short read through your code and not spotted any problems. I'd suggest that you temporarily abandon the keypad business and write a very basic routine to send/receive one byte variable PIC-Hyperterm and then PIC-PIC. Start using SEROUT/SERIN then move on to SEROUT2/SERIN2 and then HSEROUT/HSERIN.
5. Have you got carriage returns (Decimal '13') at the end of each transmission?
6. I've not looked up the data for your chips but what is TRISX?
7. Just had a longer look at the code and I think your sequencing is wrong? Should be:
a. PICA. Press key
b. PICA. Send to the other PIC (I think you receive here?)
c. PICB. Receive data
d. PICB. Send data
e. PICA. Receive data
f. PICA. Display data on LCD
g. PICA. Press key......
Watch those CRs!
8. I assume that each end of the PIC to PIC RS232 link is symetrical i.e both have RS232 chips for level conversion or both do not?
Regards Bill legge
Bookmarks