Newbie rs232-binary

Discussion in 'General Electronics Chat' started by Craig Tull, Jan 17, 2012.

  1. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    Greetings to all on the forum, I have a project that I need some help in getting pointed in the right direction. I am a Ham radio operator and have a remote tuner that is semi automatic.
    It uses a binary input to pre tune the unit to settings manually entered into the unit during setup, then when given a "tune" command and a sample signal it fine tunes to the best SWRs.
    It uses 5 binary inputs (as best as I can remember) and a tune command input, It is too far from my shack to run the binary signals out to the tuner so I would like to use some spread spectrum radios to carry the commands to the tuner, the radios have RS-232 ports for data.
    I would like to control the unit with a rotary switch, I think 12 or so "rough" settings will give me the coverage I desire, I could use a diode matrix to give the rotary switch the binary word output needed to activate the tuner.
    A serial signal should be initiated when the rotary switch is turned to a new selection or the tune command state is changed as the SS radios key on data and the outputs to the tuner should be latched until another change is initiated. It seems like it would be simple but…

    Thanks
    Craig Tull
    Papalote, TX
     
  2. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    So what you are wanting is a rotary switch at one end connected to a device to convert that rotary switch setting to RS232.

    Send the RS232 by radio.

    At the other end convert the RS232 to a 5-bit binary output and a "tune" output.

    Correct?

    5-bit binary gives you 32 different combinations, by the way.

    If correct, I can suggest ways how this could be done!
     
  3. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    Exactly JDT!!, there would be an additional switch ether a momentary or toggle for the "tune" operation, the tuner does have 32 settings expandable to 64, but because I am only going to cover 5 bands, two of witch only need 1 setting, one only needing 2 settings, one only needs 3 settings a 12 pos switch would leave 5 "rough" setting for 160 meters witch I think would be enough, I would however entertain a method that would give me 32 settings. but your grasp of the situation is spot on!!
     
  4. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    BTW there is an "out of sequence" or "failed operation" output from the tuner, it changes state during the "rough" tune operation and or if the unit can not complete the task, it would be nice to be able to monitor that status also but not absolutely necessary.
    This is normally used to prevent the transmitter from delivering RF power to the tuner during the rough tune process. Actually coarse and fine tune operations would be more correct.
     
  5. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    Right. The way I would do it is to use a small micro-controller on the receiver side to listen for the serial data. When a correct sequence of characters comes in, it sets the inputs on your tuning unit as required.

    You could have another micro-controller on the transmitter side, connected to the switch, that would squirt out the serial data when the switch is changed and the button was pressed. Easier, is to do away with the switch and use a computer with a serial port. Using Hyperterminal or similar, just type "25" (or whatever) and press return. The characters "2" "5" "<CR>" will be sent over the serial link and the micro-controller on the reciever will set the outputs to binary of 25 (for example). And after a delay, pulse the "tune" input.

    Obviously this solution requires a bit of programming. Not too difficult though. I use "PIC"s but there are plenty of others.

    Most of the time the micro-controller does nothing after running some initial set-up code. When an RS232 character is received an interrupt is triggered. All the code is in the interrupt routine. A "counter" register keeps track of which character is being received. Unless the characters are correct, the data is ignored.

    I have attached a diagram showing a simple circuit and a bit of a software flow chart (borrowed from a recent project) outlining this is done.
     
  6. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    Thanks JDT!! that looks like a plan, but getting me started with micro controllers could be dangerous, LOL,
    Craig
     
  7. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    JDT, is there any way to PM you so I can ask some dumb questions?
     
  8. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    A DTMF tone can be transmitted by anyhting that will transmit audio, and the DTMF decoder IC on the receiving end has 4bit binary output.

    That may have been the original remote control method for your remote tuner if it has a 4bit binary input.
     
  9. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    Originally it was connected directly to the radio/amplifier, it was a channelized sytem with only 32 channels (frequencies) available to the operator. Man I started to read an article on "getting started programming pics" , I thought it would be much easier than my days with the Timex Sinclare, it's pretty hard getting the old gray matter flowing in the correct direction, maybe if I keep reading it will start to make sense, but this guy has one loading 5 or 6 different programs to get the job done... I do like DJTs solution and have already aquired the needed components, I do like the idea that the parts are SO cheap considering it will be living at the base of a 320 meter loop of wire 60 feet in the air (read lighting magnet) I take a major hit on it about every two years and no telling how many minor hits.
    Craig
     
  10. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    Sorry, I have been away for a while.

    So, you have the PIC microcontroller. You can develop the program code in MPLAB which you can download for free. To program it, you need a programing device which costs. But, I agree, there is a learning curve.

    Let me ask you some questions:-

    • What baud rate does your radio system work at?
    • Is the input to the tuning unit 5 binary wires for selection + 1 momentary wire for the "load" signal?
    • Exactly what is the interface to your tuning unit -the PIC gives out 0-5V cmos logic levels. Can this go directly into the tuning unit or will there have to be voltage level changes or more current.
    If I have time I could adapt some code I have already have (because I do this for work) and possibly program a chip and post it to you. The postage probably costs more than the chip.
     
  11. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    I like THE_RB's solution. It seems like it wouldn't require any (or minimal) programming.
     
  12. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    Thanks DJT I would welcome all the help I can get, I have been intensly reading a tutorial on programming pics but nothing has clicked yet. I do have a programmer, You can email me at mj@papaloteranch.com.
    I will get out the manuals and confirm all the inputs and levels (I believe it is TTL) given it is 80s tech. The SS radios will operate at up to 9600 baud full duplex and 19.2 at half duplex, these rates are set durring setup and are "fixed" when we used these at work we ran them at 1200 "Bell" before retiring them some years ago.
    Craig
     
  13. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    OK. I'm sending something to your email address. Actually it's attached as well.

    I have written some code that will receive at 1200bd (although this is easy to change) and give CMOS/TTL outputs. Also outputs a delayed strobe pulse and sends back "OK<CR>" when a command correctly received.

    Also I have used the PIC's own internal oscillator. So now only 2 ICs and a few other bits required. I expect you to build this on a bit of stripboard about 2" square!

    NOT TESTED though!! As I haven't built it. So some code tweeking might be required. Hope not.
     
  14. Craig Tull

    Thread Starter New Member

    Jan 17, 2012
    13
    0
    WOW JDT you are awesome! give me a couple days to get it all bread boarded up.
     
Loading...