PDA

View Full Version : Is a modifier necessary?



Ramius
- 7th May 2011, 20:35
In the PicBasic Pro book under SEROUT2 they reference a "modifier" before what you plan to send. I am trying to send hex to the OSD. I can see there is data being sent, just not sure if I formatted the data string correctly? Thanks.

'******* Examples from the OSD book ******************
' Example: Clearing The Screen
' Send 0xE3h - Clear the entire screen with spaces
' Example: Sending Text
' Send 0xE5h, 0x00h, 0x00h - Set cursor position 0, 0
' Send "Hello world!" - Send ASCII text
' Example: Sending Blinking Text
' Send 0xE5h, 0x00h, 0x00h - Set cursor position 0, 0
' Send 0xE6h, 0x01h - Set character blink attribute (ON)
' Send "Blinking text!" - Send ASCII text
' Send 0xE6h, 0x00h - Set character blink attribute (OFF)
Include "Modedefs.bas"
' ** Set Xtal Value in MHz **
Define OSC 10 ' Set Xtal Frequency
' Baud is Driven, Inverted, None @ 19,200
' OSD wants 19,200, 8 data bits, 1 stop bit, inverted data
Start:
serout2 PORTB.2, 16416, [$E5,$02,$01]
serout2 PORTB.2, 16416, ["HELLO WORLD"]
goto start

Darrel Taylor
- 8th May 2011, 17:42
That looks correct to me Ramius.

I take it it's not working?

Ramius
- 8th May 2011, 18:54
Correct! I can seen there is data using a scope and it acts as if I am not sending anything!

Darrel Taylor
- 8th May 2011, 20:01
Do you have pin 18 tied to ground?

If left open, the baud rate is 9600 instead of 19200.

Ramius
- 8th May 2011, 20:43
Yes and I can use their windows computer demo program which works fine. You don't suppose that they are calling Rx and Tx the reverse of what a PIC uses?