Nope.
The numbers for the mode setting have been converted to decimal. We need to look at this from a binary point of view. If you do not have a handle on base2, things will be difficult with computers. The computer only understands two things, ON and OFF as in a switch, and most times with micros we can get away with thinking of 8 switches in a group, (or pins)
As you know with you PIC, the group of 8 is represented as bits 0 - 7.
With the SERIN2 modes we are talking about 16 switches, bits 0 - 15.
The table at SERIN2 in the manual gives the first 12 (0-12)bits of the mode and a formula to find this number.
Now we have bits 13 - 15.Code:Baud 0-12 bits Binary 2400 396 0000110001100 4800 188 0000010111100
Bit 13 is for parity. 0=None 1=Even
Bit 14 is for conversion. 0=True 1=Inverted
Bit 15 is the Output. 0=Driven 1=Open
Go to appendix A and look at Mode Number 16780. We will build this from scratch.
Bit 15 is Driven = 0
Bit 14 is Inverted = 1
Bit 13 is No parity = 0
Take bits 0-12 from above 2400 baud and put it all together.
0100000110001100
and convert to Decimal = 16780
Now for Driven Inverted None 4800.
Bits 15 - 13
010
Bits 0-12 from above 4800
0000010111100
Put it together
0100000010111100
Convert to Decimal
16572 is the Mode Number for Driven Inverted None 4800 Baud.
I hope
Here is a page to do the conversions.
http://acc6.its.brooklyn.cuny.edu/~g.../nav2tool.html







Bookmarks