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,2014-11-16 01: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/PA102014-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.2014-11-18 09: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.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.
2014-11-18 04: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....
2014-11-19 01: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?
2014-11-20 01: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.
2014-11-22 12:52 AM
Thanks fm.