UART won't run

New to XMOS and XCore? Get started here.
Heater
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

Re: UART won't run

Postby Heater » Sun Apr 24, 2011 1:54 pm

Now we are treading new ground for me.
As far as I know if you "Run As Xcore Application" it does not matter what is in the flash.
So, I was very brave and tried something dangerous. I erased all of my flash!

Like so:

xflash --id 0 --erase-all --target-file ../XC-1A.xn --noinq

Sure enough using a terminal program and power cycling my dev board shows there is no output.

Then I run the uart as Xcore application from the XDE and it works.

Then I write it to flash and it works again in my terminal from power up.

I'm running out of ideas here...
Ganux
Active Member
Posts: 35
Joined: Tue Mar 08, 2011 12:58 pm

Postby Ganux » Sun Apr 24, 2011 5:55 pm

Hi

I tried to erase my device..
Then programming it as een XCore Application doesn't work either..
if I program it in the flash.. I can't see the outcome in the XDE, right?

Ganux_
Heater
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

Postby Heater » Sun Apr 24, 2011 10:25 pm

When I program to flash I cannot see it running in the XDE console. Only if I run as xcore application.
I can see the program running from flash if I connect with terminal program like GtkTerm instead.

One thing, did you ever see a normal printf output working?

Your loop at initialization time does not look right. It has no timing in it and so the output will not be high for 10 bits.
Ganux
Active Member
Posts: 35
Joined: Tue Mar 08, 2011 12:58 pm

Postby Ganux » Sun Apr 24, 2011 11:29 pm

Hi,

added the timer.. even to do it for every bit sent..
but still nothing.. :(

Tried the printf.. added following line:

printstr("Hello World ;-) /n");

included the print.h

and i got the output!! (even with the '/n')
after that the same squares from the UART :(

Ganux_
Heater
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

Postby Heater » Mon Apr 25, 2011 7:18 am

Grrrr...

It is possible that, for some strange reason, your bit time is being set wrongly.
Getting an output shows it works but getting garbage characters is often a sign of the wrong baud rate.
As an experiment try setting the bit time directly:

#define BIT_TIME 868

Which works here.

By the way, how did you find out that the baud rate to use is 115200? I could not find a reference to that anywhere.
Ganux
Active Member
Posts: 35
Joined: Tue Mar 08, 2011 12:58 pm

Postby Ganux » Mon Apr 25, 2011 9:19 am

Tried changing it.. but stil nothing..

The Baud Rate I found somewhere reading..
XMOS has an UART-example, and i think it whas this one which said 115200bps is standard..

Greets,

Ganux_
Heater
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

Postby Heater » Mon Apr 25, 2011 11:24 am

Sadly I'm out of ideas. Hope someone else passes by here soon to help you out.
Ganux
Active Member
Posts: 35
Joined: Tue Mar 08, 2011 12:58 pm

Postby Ganux » Mon Apr 25, 2011 11:27 am

Anyway, thank you a lot for trying to help me out!!
One of these days I will have another XC-3 dev board + xtag to use, and i'll try to run it on that one..
(hardware error..)

For now i'll pass to the next part of my project:
XC-3 & UDP

Anyway, if i get my UART working i'll drop my solution here!!

Ganux
Heater
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

Postby Heater » Mon Apr 25, 2011 11:42 am

I have one last suggestion:

Try inverting all the bits before outputting them, start and stop included.

Desperate I know...
User avatar
xcorific
Member++
Posts: 17
Joined: Fri Aug 12, 2011 2:36 pm

Postby xcorific » Fri Aug 19, 2011 3:51 pm

I'm also trying to get the UART example working from the sample PDF written in 2009. I've modified my code to use the initial bits from Ganux's source, i.e. specifying the core used for the ports, and using PORT_UART_TX instead of XS1_PORT_1A. I don't have the hardware here with me, but I wanted to try to use the simulator. Heater, you mentioned using the simulator in an earlier post. Can you confirm whether or not it's worth trying to simulate the UART example, or should I wait until I get home when I can plug in my XC-1A?

Who is online

Users browsing this forum: No registered users and 2 guests