PDA

View Full Version : Confused by serin2 modes



retepsnikrep
- 3rd July 2010, 05:47
I have a 16F88 program which works well and uses Hserin and the following define and snipet of relevant code.




DEFINE HSER_BAUD 9600 'Set Baud rate to 9600bps
DEFINE HSER_BITS 9 'Set to 9 bit mode
DEFINE HSER_EVEN 1 'Set Even Parity
DEFINE HSER_CLROERR 1 'Clear overflow error automatically

HSERIN [WAIT($87), STR BCMDATA\11] 'Wait for packet start $87 then Rxd 11 bytes into BCMDATA


Now I want to transfer this program to a 12F683 chip so need to use Serin2, but although i can see what i believe the basic line should look like (below), the mode number is confusing. What mode or defines are equivalent to what I have with hserin above?

The data is 8 bit with an even parity bit.



SERIN2 Bcm, ???, [WAIT($87), STR BCMDATA\11]

mackrackit
- 3rd July 2010, 06:59
DEFINE SER2_BITS 9
SERIN22 PORTx.x, 8276, [wait($87), str bcmdata\11]