Shop OBEX P1 Docs P2 Docs Learn Events
Icom radio not communicating with Stamp — Parallax Forums

Icom radio not communicating with Stamp

I have hit a snag with a simple BASIC Stamp program - can anyone help?

Icom Amateur Radio transceivers can be controlled externally - they use a data format like this (all hexadecimal commands):
$FE $FE $80 $E0 $00 $00 $57 $08 $07 $00 $FD - this is the command to set the radio frequency to 7085.7 kHz.

Here's a breakdown of the commands:
$FE $FE is a fixed code preamble
$80 is the data address of the radio
$E0 is the data address of the controller
$00 is the command to set frequency
$00 $57 $08 $07 $00 is a string of BCD commands to set the frequency - in this case, (reading from right to left) 00 - 07 - 08 -57 - 00 which ends up as 7085.7 kHz.
$FD is a fixed end of message code

Here's my problem:

I am using SEROUT with my BASIC Stamp BS2sx to send this code, but the radio is not responding. I have other programs that are running on my computer - they work fine and do just what they are supposed to. These programs are running 9600 8N1. I have tried different baudmodes with the Stamp, both Inverted and True, but I still get no response.

I am using the dedicated serial port (16) to communicate with the radio. I tested the radio to serial port interface, and it's working properly.

Here's my code:

'==========================================
' Send data to Icom using SEROUT

' {$STAMP BS2sx}
' {$PBASIC 2.5}

'Test to see which of these is needed:
'BaudModeTrue9600 CON 240 '9600, 8N1, True
'BaudModeInverted9600 CON 16624 '9600, 8N1, Inverted
'BaudModeTrue1200 CON 2063 '1200, 8N1, True
BaudModeInverted1200 CON 18447 '1200, 8N1, Inverted

SEROUT 16, BaudModeInverted1200, [$FE $FE $80 $E0 $00 $00 $57 $08 $07 $00 $FD]
'Sends 7085.7 to radio to set Frequency
'==========================================

I'm hoping someone has some experience with this - I am a Stamp newbie.

Thanks ...

Comments

  • I could be mistaken, but shouldn't that list of hex characters be comma separated ?
  • Good catch - You're exactly right - I copied the code from a text file for this post, but the actual code is comma separated - it tokenizes and loads correctly.
  • BeanBean Posts: 8,129
    Maybe the radio doesn't like TTL level serial. That is 0V and 5V. Some devices want negative voltage and/or greater than +5V.
  • Good suggestion - I'll check the levels. Thanks ...
  • Problem Solved! Bean's post was right on the money. The radio interface is a TTL port - I was running it through a level converter to use the Stamp's RS-232 port. I revised my program to send the output to a Stamp pin, then connected that pin directly with the radio - works like a charm. Thanks, Bean, for your comment - it solved my problem.
  • BeanBean Posts: 8,129
    Your welcome. I'm glad you got it working.

    Bean
Sign In or Register to comment.