Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Uart Problem

Altera_Forum
Honored Contributor II
996 Views

Hi everybody, 

 

I need to write or read a package to UART. Package like 

 

0xFF 0xFF 0x01 0x04 0x02 0x2B 0x01 0xCC 

 

This package or packages like that are needed to be sent to control Dynamixel RX-28 motor.  

 

How can i send a package like given above to UART. How does the definition must be? 

 

P.S. I have a RS485 Breakout connected to UART to feed motor. 

 

Thanks for replies and helps. 

Best Regards.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
330 Views

I think you are using the standard UART controller component available in sopc builder. 

You'll find all the information you need in the embedded peripherals guide, under UART section: 

http://www.altera.com/literature/ug/ug_embedded_ip.pdf 

Basically, if you need to transmit a simple characters sequence, as you ask, you simply need to init the controller (set baudrate and line control register) and write the bytes into tx register.
0 Kudos
Altera_Forum
Honored Contributor II
330 Views

Thanks Cris72 

 

I have drive 12 pieces RX-28 servomotors and i have less time.I don't know how can drive.The UART is enough to read or drive digital servomotors? I search the forum and i found the FIFO and DMA . How can use these because i don't know how they work or the FIFO and DMA must be use for my project ???.my project is FPGA based biped robot control and balance algorithm design.I read H48c accelerometer(it gives me x,y,z position and tilt) on FPGA and now i must read the motor position to get balance position on robot :confused:.
0 Kudos
Altera_Forum
Honored Contributor II
330 Views

 

--- Quote Start ---  

T.I don't know how can drive.The UART is enough to read or drive digital servomotors?  

--- Quote End ---  

 

You must refer to servomotor specification in order to know HOW you can drive them. 

You can have different modes of operation. For example: 

- positioner: the serial port sends the target position and the drive executes the motion with a predefined profile 

- trajectory step: the serial port sends trajectory points at fixed intervals and the drive will follow them; the serial port master must take care to generate the correct motion profile 

- open loop: you directly drive a current value into motor windings; then your system must read position and close the loop to keep motor in position. 

Depending which mode you are using, you need to operate uart very differently. 

With a positioner you can simply send and receive data asynchronously, when you need the motor to move, without any precise timing. 

For other modes you need to operate uart with a timer, using interrupts and possibly dma.
0 Kudos
Reply