Sending data via UART
Answer
6/25/15 11:44 AM
Hello,

I have tried to send data via the UART interface. The routines SET_SerialInit and SER_serialWrite give back  SER_SUCCESS but there is not output to the pins. Only the buffer seems to be filled, if the buffer is full, an error is returned. I have tried UART, USART, LEUART, both ports (U1 and U2) and different baud rates.
How can I send the data to the pins?

Thanks,

Jürgen Schuster
 
0 (0 Votes)
Sending data via UART
Answer
6/26/15 9:39 AM as a reply to Jürgen Schuster.
Hello,

In the meantime I've also tried to send via GPIO and SPI. GPIO works, but I don't want to morse my data. SPI doesn't work, I've tried SPI1 and SPI2 with different baud rates, there is no clock and no data on any pins, but SPI_init and SPI_write return SPI_SUCCESS. Has anyone ever tried this successfully?

Jürgen
 
0 (0 Votes)
Sending data via UART
Answer
6/26/15 11:14 AM as a reply to Jürgen Schuster.
Hello Jürgen,

the SER_serialWrite function does not deliver data to the remote device directly. To use this function merely copies the supplied data to an internal ring buffer as you have mentioned. 

A very good example for SPI is at:

platform\device\sdcard\SDC_sdCardDriver\SDC_sdCardDriver_cc.c

in the following functions:

·         sdCardSpiInitialize
·         sdCardSendCmd
·         sdCardBlockReceive

Please let me know, if this helps you!

Regards,
Manuel
0 (0 Votes)
Sending data via UART
Answer
6/29/15 7:02 AM as a reply to Manuel Cerny.
Hallo Manuel,

Yes, so says the documentation too. But now, how to send the data in the ring buffer to the pins? SPI_write does not much more than calling SER_serialWrite. When I enable the UART1  clock, the ring buffer doesn't overflow. But where ist the output?
As I see, the sdCard driver uses SPI1. So where is the port to the pins B1-4 = U1 and B5-8 = U2?

Thanks,

Jürgen
 
0 (0 Votes)
Sending data via UART
Answer
6/29/15 11:28 AM as a reply to Jürgen Schuster.
Dear Jürgen,

I assume that you try to connect to the extension bus of the XDK, not to the SD card.
I general, most of the pins work as GPIOs and can be configured to specific fuctionalities; to avoid interfering with internal functions we give some recommendations which pins should be used if you want to connect a UART or USART device.
As an example, if you are connecting an SPI device via the extension board (USART2), it should work with
PB3: SPI_MOSI
PB4: SPI_MISO
PB5: SPI_CLK
PD8: SPI_CS
Pleas note that all pins on the extension bus work on a voltage level of 2.5V

Best regards,
Mathias
0 (0 Votes)