rs232 to spi

enonod

Well-Known Member
Licensed User
Longtime User
I need to use the RS232 port to control the 3 interface connections of an SPI interfaced device. RS232 does not provide a clock signal and SPI requires one.
My thinking is that if I control RTS DTR as data and load the clock might?? be provided by sending a continuous, say, RY out on the RS232 Tx.
I can foresee a problem with the start stop bits but this might be overcome by selecting the R or Y characters to fit.
I can use a MAX232 to convert the voltage levels.

For specifics, I am interfacing the MAX7219 LED matrix driver and do not have the facilities to program a PIC controller to do the job, so it must come down to a serial port and some software. All my findings on the internet use a controller.

Does anybody have any experience or suggestions please?
 

pdablue

Active Member
Licensed User
Longtime User
RS232 to SPI Questions.

Hi,

Kronos Robotics sells PIC microcontroller chips that have a Basic Interpreter
programmed into them.

Their ATHENA microcontrollers have a built in UART and the BASIC language
commands support SPI devices.

The have free IDE programming software that you can download and
run on a PC.

You write your program in BASIC using their IDE, then you download the
program to the ATHENA microcontroller using an RS232 connection.

The ATHENA microcontroller would handle talking to the SPI device.

(PC) > (RS232 Adapter) > (ATHENA Microcontroller) > (SPI Device)

Maybe that solution will work for you.

The ATHENA is a low cost microcontroller that comes preprogrammed
with an on board Basic Interpreter.

The Development and Programming software is Free.

They also sell a low cost EASY RS232 kit for interfacing between a
PC serial port and the Athena microcontroller.

They have 3 different microcontroller chips with BASIC Interpreters
programmed into them: ATHENA, PERSEUS and NEMESIS

The NEMESIS microcontroller has the best set of features of the three.

For more info visit: (www.kronosrobotics.com)
 
Last edited:

Zenerdiode

Active Member
Licensed User
... if I control RTS DTR as data.

You're suggesting using 'Bit-Banging' to output data on the RTS/DTR pins? I think running a Basic4PPC application (or even a .Net app) will introduce far too much latency as the OS does its time-slicing. I think you're going to have to feed a PIC to drive your LED driver.
 

TyuTyu2

New Member
Licensed User
Longtime User
Hi,

Take look: Home - MCS Electronics
There is a basic compiler for avr and 51 family. (IMHO avr better).
With demo you can solve the problem easy. (few lines code).
If you have space to use DIP packaged ICs it's "weekend project" :)
 

enonod

Well-Known Member
Licensed User
Longtime User
Wow what a response. Thank you, that was really useful and will keep me busy for a few hours yet.
I have followed pdablue's suggestions first because it seems very straightforward. I assumed a programmer was needed.
Having followed that path I came across a thing called arduino which seems to be very interesting since I do a lot of electronics projects. It has a thing called bootloader built into the controller so that a programmer is not needed, just rs232 or usb.
I am looking into both at present which will keep me busy as I follow the trails wherever they lead.

Thanks again for putting me on the right track.
 

enonod

Well-Known Member
Licensed User
Longtime User
Just as an update so that people know that their answers do spawn success.
Arduino did solve this problem. It uses an AVR MCU with bootloader built in.
The matrices are displaying nicely in 3 colours.

Thanks for the leads that took me there. It opened a whole new world for me and now I cannot leave it alone.
 
Top