PDA

View Full Version : Serout2 HELP



shawn
- 13th February 2008, 01:50
Hello
I currently use serout to send characters to a one wire lcd display. I would like to use serout2 instead because of some of it added features. I'm using N9600 for my serial out using serout. This mode has always worked for me without any problems. Correct me if I am wrong but using N9600 with serout does the following. 9600 baud, Driven Inverted, 8N1, not open.
So then in order to set my mode for serout2 Bit 15 = 0, bit 14 = 1, bit 13 = 0, and the lower 13 bits = 84 for 9600 baud. So my mode should be 16084. Am I close I've messing around with this off and on for a week with no resolve. What am I missing.

Please Help

This is working.

Define OSC 20

Pause 1000 ' let lcd startup

Serout2 Portc.3,6,["help"]

END

This does not

Define OSC 20

Pause 1000 ' let lcd startup

Serout2 Portc.3,16084,["help"]

END

Thanks
Shawn

skimask
- 13th February 2008, 02:25
I currently use serout to send characters to a one wire lcd display. I would like to use serout2 instead because of some of it added features. I'm using N9600 for my serial out using serout. This mode has always worked for me without any problems. Correct me if I am wrong but using N9600 with serout does the following. 9600 baud, Driven Inverted, 8N1, not open.
So then in order to set my mode for serout2 Bit 15 = 0, bit 14 = 1, bit 13 = 0, and the lower 13 bits = 84 for 9600 baud. So my mode should be 16084. Am I close I've messing around with this off and on for a week with no resolve. What am I missing.
Shawn

Need to bone up on your binary math....

Bit 15 = 0
Bit 14 = 1
Bit 13 = 0
Bit 12-0 = 0 0000 0101 0100

Bit 14 = 2^14 = 16384
Bit 6 = 2^6 = 64
Bit 4 = 2^4 = 16
Bit 2 = 2^2 = 4
Total = 16,468

Back of the manual has all sorts of SerIn2/SerOut2 mode examples.

shawn
- 13th February 2008, 02:47
skimask
Thank You I'm not sure what I was thinking, but my binarry was wrong
thanks again shawn.