PDA

View Full Version : Hanging on SERIN2 - SOLVED!



blainecf
- 13th July 2006, 17:25
Problem:
SERIN2 would never time-out

Domain:
PIC to PIC communications using standard TTL I/O pin, where second PIC may or may not be present. Chips particularly involved in this project: 18F4550, 18F458

Discussion:
The mode for SERIN2 is very picky about line conditions (from my recent 2 days wasted tracking this down!)

Some modes WANT infinite ohms, some modes will not work WITH infinite ohms.

Here's the problem. If you use a (cheap) scope, it alters the resistance and causes some modes to fail. If you use the modes that work with the scope, and then remove the scope, they fail.

Solution:
Use the modes that require some resistance (see below), and add a 10k (or more) resistor to ground (pull low). Then SERIN2 will work regardless of whether your scope is connected!

See pages 201,202 of the PicBASIC PRO manual (or equiv. other reference) for more details.


Mode Result Mode Detail
______ ___________________ ____________________________
49548 Works with resistance Output Open, Conversion Inverted
41356 Hangs with resistance Output Open, Conversion True
396 Hangs with resistance Output Driven, Conversion True
16780 Works with resistance Output Driven, Conversion Inverted
33164 Hangs with resistance Output Open, Conversion True

Notes:
1. Above modes are for 2400 baud; for different bauds, match the other mode details.
2. These are the only modes I tested. If you're having similar problems, create a simple benchmark and test each of the modes you're interested in.


P.S. My humble apologies to everyone in advance if this info turns out to be bogus. I'm just reporting what's happend on my bench.



(Search Key words: resistor pull-down serin2 hang timeout time-out time out comm mode)

blainecf
- 13th July 2006, 18:55
This also seems to be necessary for chip-to-chip communications. If the first letter you receive is correct, and the rest is garbage, this should solve it.