9bit uart on 11920 baud rate

New to XMOS and XCore? Get started here.
jolly
Junior Member
Posts: 5
Joined: Fri Mar 12, 2021 10:55 am

9bit uart on 11920 baud rate

Postby jolly » Fri Mar 12, 2021 11:06 am

Hey XE
I just got a XK-AUDIO-216-MC-AB and need to find out if it would be possible to set up a uart with 9bits on the board?
I have an old legacy system I need to connect it to, with 9bit uart on 11920 baud rate.
I found the Uart lib and datasheet but can find it mention anywhere if possible, so before I wasted countless week trying to, I figured id ask first :D

Best regards
Jolly
User avatar
akp
Respected Member
Posts: 510
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Mar 12, 2021 3:12 pm

Yes, it's possible. The selected platform isn't the best for getting GPIO. You're probably in luck that the MIDI IO will support the baud rate you need. However, you'll need to write your own uart code (you can modify the existing stuff) since the existing code doesn't consider 9 bits bytes. It allows 1 to 8 bits per byte.

You will have to write it yourself. At 11920 bps you've got tons of clock cycles so you don't have to worry about your code being efficient.
jolly
Junior Member
Posts: 5
Joined: Fri Mar 12, 2021 10:55 am

Postby jolly » Fri Mar 12, 2021 4:17 pm

I am missing a zero :(, it should be a standard 19200 baud rate (my bad).
I had a look in the Uart lib and look like that i would be possible to modify the files.
Also, it seems like the IO I can use on the board would be the MI_RX and MI_TX?

Thanks for taking time responding and helping me.
jolly
Junior Member
Posts: 5
Joined: Fri Mar 12, 2021 10:55 am

Postby jolly » Fri Mar 12, 2021 4:28 pm

I cannot seem to hit the keyboard right today, i mean 19200 ofc. Jesus
Lucky it is Friday
jolly
Junior Member
Posts: 5
Joined: Fri Mar 12, 2021 10:55 am

Postby jolly » Fri Mar 26, 2021 12:55 pm

Would it be possible to use the SDI0(1-3) pins as half duplex uart pins? it seems if i take off the jumper it would work just as free pins.
I am trying to run the example code of the half duplex but cant seem to get it to work just with 8bit(befor i try to get it to 9) :)
User avatar
akp
Respected Member
Posts: 510
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Mar 26, 2021 12:58 pm

That would probably work. The whole 4 bit port would have to be all output or all input at the same time, you won't be able to have one of the pins as an input and another as an output in push pull mode. There is an open drain mode that could probably do half duplex with multiple pins on a port transmitting and receiving at the same time but I haven't looked at the half duplex uart so I don't know if that's supported with the out of the box code.
jolly
Junior Member
Posts: 5
Joined: Fri Mar 12, 2021 10:55 am

Postby jolly » Fri Mar 26, 2021 2:04 pm

Hey agian AKP, thank you for taking time to help a newb :)
So, it would not be possible to do an in and out pin at the same time with the xSDI pins? i though if i reconfigured them it would be possible?
I am trying to go off the https://www.xmos.ai/download/lib_uart-[ ... .0rc1).pdf page 8
Maybe i should reconfigure some other pins on the board? i know it no the smartest plan as a new person to xmos, but i need the audio interface :,)
User avatar
akp
Respected Member
Posts: 510
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Mar 26, 2021 4:04 pm

Sorry, the SDI pins are on one bit ports so you can absolutely use them for UART if you don't need them for audio.

Who is online

Users browsing this forum: No registered users and 1 guest