Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

just a few questions on rs232

Status
Not open for further replies.

ghostman11

Well-Known Member
hi i just wanted to check a couple of things. are the following assumptions correct?
if i have say a dozen pics all using rs232, in therory i can connect all together and send a command from a pc with say an address first, all chips read the bus but unless the address is theres they ignore the next 4 bytes?.
am i missing somethimng obvious that would prevent me doing this?

cheers
 
hi i just wanted to check a couple of things. are the following assumptions correct?
if i have say a dozen pics all using rs232, in therory i can connect all together and send a command from a pc with say an address first, all chips read the bus but unless the address is theres they ignore the next 4 bytes?.
am i missing somethimng obvious that would prevent me doing this?

Not at all - it's been done MANY times - if you check Dontronics there's a VERY, VERY old project there called the PicAxe (named long before the BASIC interpreter that now uses the name) which does exactly what you're talking about.
 
You also know that an RS232 converter IC is needed between the PIC UART RxD bus and the PC serial port correct?

People have cheated and gotten it to work without it, but there's no guarantee that it will work reliably unless you have one.
 
Last edited:
You also know that an RS232 converter IC is needed between the PIC UART RxD bus and the PC serial port correct?

People have cheated and gotten it to work without it, but there's no guarantee that it will work reliably unless you have one.

There's no 'guarantee', but it's almost 100% certain to.
 
You also know that an RS232 converter IC is needed between the PIC UART RxD bus and the PC serial port correct?

People have cheated and gotten it to work without it, but there's no guarantee that it will work reliably unless you have one.

I have not used RS232 converter ICs for a long time. USB to serial converters are the way to go..

To answer the original question: Yes, you can have one master to send rs232 messages and have many controllers receiving it. Don't forget the possibility of broadcast; one message sent and everybody receives it. The master can also ask for individual microcontrollers to send some information back. And.. if you refine the idea far enough.. you end up with what is called USB.
 
Last edited:
the range is very short,max232 taken care of. the pc has a double serial port card so i thought using that would make writing the pc software easier infact i have a question regarding that but will save it for another day!
all i need at the mo is for the chips to pass data for logging, later i might go for two way stuff. i have serial to usb chips but for this project i prefer RS232. it's nothing special just logging fan speeds and current used from 250 small fans. i will probally alter the entire project later
cheers all for the info
 
the range is very short,max232 taken care of. the pc has a double serial port card so i thought using that would make writing the pc software easier infact i have a question regarding that but will save it for another day!
all i need at the mo is for the chips to pass data for logging, later i might go for two way stuff. i have serial to usb chips but for this project i prefer RS232. it's nothing special just logging fan speeds and current used from 250 small fans. i will probally alter the entire project later
cheers all for the info

If you check the PicAxe I mentioned earlier, they allowed you to access individual pins, set then as in or out etc. using some simple ASCII commands.
 
If you want to connect ics together and be able to use adresses and all that have a look at the i2c ssp module on a few midrange pics, that is exactly what they are there to do, unless you want long range.
 
Last edited:
slightly hard to explain but i am using rs232 because of pc element, i am using the ssp module as well but that is for someing else, the quick explanation is pc is logging data and checking values against a table if a value is outside range then pc sends comands to the next 4 fan controllers on the list asking for data update, this is checked and if still out of range job is done and those 4 controllers shut down. this is reaped untill all controllers are off. ;)
 
250 devices is going to be tough for any bus implementation. Still, RS485 is more suitable for Master/Slave low speed communication. There are available RS485 "Hubs". They are not hubs in the traditional sense, but can help you have a central distribution point.
 
250 fans is a sizeable project.
The o/p will probably have a controller per so many fans so 250 rs232 devices is unlikely, that said it'll still be a fair network, there'll be a delay if you 'talked' to every device at 9k6 baud.
 
Last edited:
Why does every PIC need to be on the async serial bus? Why not have 1 PIC per x number of fans, then assign a separate PIC as the main controller that talks to the "driver PICs"? Interface the UART of the main controller PIC to a serial port. MIDI -> USB cables are an awesome way to talk to a PIC via PC and communicate at a much faster baud rate (31.25K as opposed to 9.6K). Plus, MIDI only needs a high speed optoisolator on the UART RxD pin of the PIC. MIDI is a 5mA current loop interface capable of driving distances of up to 50ft. The main controller PIC can then interface and relay the PC data to the driver PICs via SPI or I2C bus.

Something like this -

**broken link removed**

Click here for the full size image -

https://i213.photobucket.com/albums/cc189/flemingmras/FanControl-1.png

The long and short of it is that the first PIC handles all of the asynchronous serial communications to/from the PC. It then relays the PC data to the other PICs via the I2C bus. The first PIC and the other PICs can also talk amongst themselves. I2C is half duplex though. You can do an SPI bus instead if you want faster communication rate between PICs and full duplex.
 
Last edited:
Oh that's right this is a hobbyist site. Crude designs are of the norm and strongly encouraged here. ;)

It is a hobbyist site, but there's nothing 'crude' about it, and it's used in many professional products - the reasons for the voltage ratings of RS232 are mostly historical, and refer to mechanical teletypes etc.

Presumably your point of view is to bung the price up for no good reason, except presumably to present a larger bill? :p
 
The voltages were these to get the distance: -25 to -3 and +3 to +25. Now the levels are as low as TTL, but you don't go 1500' with a TTL signal. I've interfaced things that used +-5V and have had problems.
 
Actually, RS-232 defines the physical (voltage, connectors, etc.) attributes of a serial interface. It does not define the data communication protocol. One thing about the RS232 standard, is that it does not (officially) support daisy chaining. It is for one-to-one communications.

If you want to address multiple nodes on a bus, you should look at an electrical system that supports multiple talkers and listeners. Either sink only drivers with a pullup resistor like I2C, or tristate output drivers like RS-485.

The serial data protocol between your PC and the TX and RX pins of microcontroller is up to you to define, based on what you want to do. Many uarts support 9-bit bytes where the extra bit defines the other 8 bits as an address or a data byte.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top