Communicating with a radio reciever
cknizeski
Posts: 3
Hi
I am trying to remotely control a Radio Scanner using RS 232. The reciever instruction manual says:
BPS Rates 4800/9600/19200/38400/57600/115200
Start/Stop bit: 1 bit, 1 bit
Data length 8
Parity Check: none
Code: ASC11
Flow Control: none
Return Code: Carriage Return only
It also states "Commands are required to wait for a response from the scanner, then, next command accecepted.
Whenever I send out a command it usually will return an error, but every now and than work, or will do something other than the command request. I am still learning using serial communication. It seams to work fine whenever I first turn the scanner on and sent the first command.
display VAR Byte(10)
counter VAR Nib
vol VAR Byte(10)
vol(10) = 0
INPUT 5
SEROUT 14, 84, [21]
PAUSE 5
SEROUT 14, 84, [22, 12]
PAUSE 5
DO
INPUT 5
IF IN5 = 1 THEN
SEROUT 16, 84, ["VOL", CR]
SERIN 16, 84, [STR vol\6\CR]
ENDIF
SEROUT 14, 84, [12, STR vol]
LOOP
Anyone know what I am doing wrong?
Thnaks
Chris
I am trying to remotely control a Radio Scanner using RS 232. The reciever instruction manual says:
BPS Rates 4800/9600/19200/38400/57600/115200
Start/Stop bit: 1 bit, 1 bit
Data length 8
Parity Check: none
Code: ASC11
Flow Control: none
Return Code: Carriage Return only
It also states "Commands are required to wait for a response from the scanner, then, next command accecepted.
Whenever I send out a command it usually will return an error, but every now and than work, or will do something other than the command request. I am still learning using serial communication. It seams to work fine whenever I first turn the scanner on and sent the first command.
display VAR Byte(10)
counter VAR Nib
vol VAR Byte(10)
vol(10) = 0
INPUT 5
SEROUT 14, 84, [21]
PAUSE 5
SEROUT 14, 84, [22, 12]
PAUSE 5
DO
INPUT 5
IF IN5 = 1 THEN
SEROUT 16, 84, ["VOL", CR]
SERIN 16, 84, [STR vol\6\CR]
ENDIF
SEROUT 14, 84, [12, STR vol]
LOOP
Anyone know what I am doing wrong?
Thnaks
Chris
Comments
How does the receiver handle the different Bauds? Is there a setting in the receiver? Does it do auto-Baud detection ... that doesn't always work.
I will give ti try with the MAX232.
Correction: the MAX232 inverts the signal, but RS232 requires an inverted signal, so you'd use the same Baud constant (84) as you used before. ... What PJ says ...
Chris