PDA

View Full Version : simple error?



Ramius
- 30th April 2011, 01:54
So I get this message "Warning [202] Argumnent out of range. Least significant bits used. What's wrong?


'************************************************* ****
'* Name : RS-232-OSD-TEST.BAS *
'* Author : Ed Cannady *
'* Notice : Copyright (c) 2005 All Rights Reserved *
'* *
'* Date : 4/29/2011 *
'* Version : 1.0 *
'* Notes : For a 18F1320 *
'* : *
'************************************************* ****
'******* Examples from the OSD book ******************
' SEROUT2 PORTB.0 ,16416, [$E3, $E5, $00, $00, VARIABLE1, $E5, $01, $00, VARIABLE2]
' 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 20 ' Set Xtal Frequency
' Baud is Driven, Inverted, None @ 19,200
' OSD wants 19,200, 8 data bits, 1 stop bit, inverted data
num1 var word
num2 var word
num1 = 1000
num2 = 2000

Start:
serout2 PORTB.0,16416,[$E5,$02,$01,$E50,num1,$E5,$03,$01,$E53,num2]
End

ScaleRobotics
- 30th April 2011, 02:42
It doesn't like the 3 digit hex numbers:
serout2 PORTB.0,16416,[$E5,$02,$01,$E50,num1,$E5,$03,$01,$E53,num2]

Don't you want to send a $E5,$0 or something like that anyway?

Ramius
- 30th April 2011, 11:38
Hi Walter!
Thanks I just got carried away with the "E's" and it should be $50 and $53!