Controlling multi RS422 interfaced slave devices independently using stm32 series mcu?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-16 10:34 AM
Hello Friends,
I have a stm32f4 discv. board and need to drive 6 motor drivers independently that have RS422 interface (just send command, no pwm calc.) How can i do that with discv board or in new designing ? Is 1 usart, 1 rs422 tranceiver is enough, if so is there any example for this scenario or can someone share a small code block for just controlling specific slave device among many slaves? A simple topology i want to design is like that: http://www.datasheetdir.com/Rs-485-And-Rs-422-Physical-Topologies+Application-Notes Many Thanks,- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-16 1:09 PM
Electrically that would appear to be sufficient, you'd want to ponder the addressing and protocol for the data expected by the motors.
Such an interface could be attached to an STM32 board, the STM32F4 DISCO can't use USART1 on PA9/PA10Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-17 10:19 AM
Hello Mr Clive,
First thanks for your prompt response. You mean one usart will be enough as working Master in the bus right ? if so is there any example for sending a specific command to the specific device (slave) using rs422 comm bus. Thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-18 9:59 AM
You'd send data to the USART in the same fashion you would if it where connected to RS232 transceivers. What baud rate, and what data bytes, would depend on the expectations of the receiving devices (motors).
You have to pay attention to ensure only one slave at a time responds, their protocol documentation presumably covers this, and other details, which I'm not privy too. One USART should be sufficient provided each device can be uniquely addressed.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-18 12:54 PM
Mr clive hi again,
''One USART should be sufficient provided each device can be uniquely addressed.'' İf rs422 is not a protocol and just an electrical layer defination so how can we adress the data ? I meanwe send like that:
USART_SendData(USART1, 0x49); // Send 'I'
So when it is rs422 transfer, how we will send data to specific device (slave) and according to which standart it is defined like:
adress (x byte)/data (y byte)/checksum (1 byte)/ ... etc.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-18 4:38 PM
The manual for the motors would be the controlling document here. You haven't specified what they are, so I'm at a loss at this point....
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-19 1:32 PM
Clive, for now i dont have motor. Generally want to fıgure out rs422, You mean there is no strict rule:
USART_SendData(USART1,X)
Here X byte array can be built in many ways like start, address, data. .. or address, size, data... or somethınk else. Developers build custumized byte array and a not written protocol rules work am i right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-20 1:10 AM
>Clive, for now i dont have motor.
But you can surely download the specification/manual for that motor, and see what protocol it requires for driving it (I guess CAN or Modbus ...). >Generally want to fıgure out rs422, Again, as said, the difference to ''normal'' RS232 is mostly hardware, except for the direction control (transceiver enable). >You mean there is no strict rule:
USART_SendData(USART1,X)
And again, this is defined by the protocol your motors require.
You need to implement a (SW) driver for that, but first, you need to find out wich one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-22 12:52 AM
Thanks fm.
