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
'******* 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