Page 3 of 4

Re: UART won't run

Posted: Sun Apr 24, 2011 1:54 pm
by Heater
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...

Re: UART won't run

Posted: Sun Apr 24, 2011 5:55 pm
by Ganux
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_

Re: UART won't run

Posted: Sun Apr 24, 2011 10:25 pm
by Heater
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.

Re: UART won't run

Posted: Sun Apr 24, 2011 11:29 pm
by Ganux
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_

Re: UART won't run

Posted: Mon Apr 25, 2011 7:18 am
by Heater
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.

Re: UART won't run

Posted: Mon Apr 25, 2011 9:19 am
by Ganux
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_

Re: UART won't run

Posted: Mon Apr 25, 2011 11:24 am
by Heater
Sadly I'm out of ideas. Hope someone else passes by here soon to help you out.

Re: UART won't run

Posted: Mon Apr 25, 2011 11:27 am
by Ganux
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

Re: UART won't run

Posted: Mon Apr 25, 2011 11:42 am
by Heater
I have one last suggestion:

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

Desperate I know...

Re: UART won't run

Posted: Fri Aug 19, 2011 3:51 pm
by xcorific
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?