HFU HF Underground

Technical Topics => The RF Workbench => Topic started by: redhat on September 04, 2019, 2100 UTC

Title: I need some help writing some arduino code for RS232
Post by: redhat on September 04, 2019, 2100 UTC
This could very well become a community project.  See related video here https://youtu.be/EwMDEjv1Hfc (https://youtu.be/EwMDEjv1Hfc)  I have built a DDS based VFO, but need some way to control it once embedded in the bowls of various pieces of equipment.  The basic idea is this; the project listens to an RS232 port for valid commands.  if it receives something like "f=6925<CR>" the VFO output frequency is set to 6925 KHz and echos "f=6925<CR>".  It would also be nice if other commands like "RF ON", "RF OFF" and "f+5", +10, etc could be implemented.

I've looked all over and haven't really found anything like what I need.  The biggest problem seems to be how to get the serial data into a string, and then begin processing it once it detects a carriage return.  if/then/else statements could then be used to carry out the desired functions.

Thanks in advance,

+-RH
Title: Re: I need some help writing some arduino code for RS232
Post by: JimIO on September 04, 2019, 2308 UTC
People have done that, search 'arduino ad9850'.
If you want to start from scratch search 'arduino serial.begin(9600)'.
Title: Re: I need some help writing some arduino code for RS232
Post by: redhat on September 04, 2019, 2346 UTC
Quote
People have done that, search 'arduino ad9850'.
If you want to start from scratch search 'arduino serial.begin(9600)'.

I've been down that road many times and have not found anything close to what I'm looking for.  If your so sure its out there, you could bring a link.

+-RH
Title: Re: I need some help writing some arduino code for RS232
Post by: OgreVorbis on September 05, 2019, 0622 UTC
This could very well become a community project.  See related video here https://youtu.be/EwMDEjv1Hfc (https://youtu.be/EwMDEjv1Hfc)  I have built a DDS based VFO, but need some way to control it once embedded in the bowls of various pieces of equipment.  The basic idea is this; the project listens to an RS232 port for valid commands.  if it receives something like "f=6925<CR>" the VFO output frequency is set to 6925 KHz and echos "f=6925<CR>".  It would also be nice if other commands like "RF ON", "RF OFF" and "f+5", +10, etc could be implemented.

I've looked all over and haven't really found anything like what I need.  The biggest problem seems to be how to get the serial data into a string, and then begin processing it once it detects a carriage return.  if/then/else statements could then be used to carry out the desired functions.

Thanks in advance,

+-RH

Maybe this would help:
https://arduino.stackexchange.com/questions/48333/very-basic-arduino-uno-serial-readstring-operation (https://arduino.stackexchange.com/questions/48333/very-basic-arduino-uno-serial-readstring-operation)
Title: Re: I need some help writing some arduino code for RS232
Post by: Monophonia on September 06, 2019, 1449 UTC
You described your solution, reading strings as they come over the serial bus.

A few years ago I made a bit of arduino code that read a character from the serial line and did a simple action (relay open, relay close, relay position, etc) I can probably dig up the code from that given time.

In my DDSVFO implementation, I use SI5351a boards since they make a nice strong square wave. They talk to the arduino using I2C. I also use an I2C/HD44780 adapter to drive the display to save I/O on the arduino. The display and Si5351a sit on the same bus, then the rest of the arduino pins are free for buttons, relays, and A/D inputs. My "brain board" uses a single arduino and has enough I/O to drive T/R and sequencing relays, 4 ADCs to sample current, voltage, power, etc. My low level PWM modulator sits on the same board as well.

You have my number, send me an email and I'll share more details.
Title: Re: I need some help writing some arduino code for RS232
Post by: Josh on September 06, 2019, 1810 UTC
Oooo!  write it in asm!



https://forum.arduino.cc/index.php?topic=37130.0
Title: Re: I need some help writing some arduino code for RS232
Post by: redhat on September 16, 2019, 1440 UTC
A couple of people sent me some links that were helpful, and I'm also working with another guy on here to further develop some of the transmitter control system.

Thanks all,

+-RH
Title: Re: I need some help writing some arduino code for RS232
Post by: JimIO on September 22, 2019, 1428 UTC

"I've been down that road many times and have not found anything close to
what I'm looking for.  If your so sure its out there, you could bring a link.


+-RH"

Sorry for the delayed response, isp problem.
Why do you want to use RS232, for remote control?
Why not a lcd 1602 keypad shield?
What aduino and dsp are you going to use?
I have some uno clones and prototype boards and a ad9830
and ad9850 module that I got for something like this.
I'd like to be part of the project.

Title: Re: I need some help writing some arduino code for RS232
Post by: redhat on September 22, 2019, 1820 UTC
The control point and transmitter will be separated by some distance, and a RS232 link exists between those points.

+-RH