Demo UART, XTAG-2 UART-to-USB questions

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
landon
Experienced Member
Posts: 71
Joined: Mon Sep 06, 2010 4:05 pm

Demo UART, XTAG-2 UART-to-USB questions

Post by landon »

I'm studying the app_xk1_demo.1v0 application and trying to understand how to look at the TX UART output via host tools.

I have connected a scope to the TX (P1J0) pin on the XTAG-2 XSYS connector and I can see characters flying by on the wire - I commented out the getch() in test_uart() code so it won't block waiting for input:

Code: Select all

while (1)
  {
    uart_putch('\r');
    uart_putch('\n');
    uart_putch('x');
    uart_putch('k');
    uart_putch('-');
    uart_putch('1');
    uart_putch('v');
    uart_putch('1');
    uart_putch('.');
    uart_putch('0');

    //c = uart_getch();
    //uart_putch(c);
  }
It's constantly pushing characters and I can see them flying by on my scope.

My question is, where does this come out w/r to XTAG-2. The XK-1 Hardware manual says:

"If a UART is required, it can be implemented in software by sampling and driving these ports at the required rate. The XTAG-2 peforms a UART-to-USB conversion on these pins, which is interface by a proprietary XMOS terminal emulator."

I see the demo program output from printstr() calls in my XDev console window:

Code: Select all

XK-1 Demo program, v1.0, ESawdust variant
testing flash...
flash device Id: 1F66011F
running demo
...
I assumed this was using the UART_TX pin, but doesn't seem to be - I don't see any scope output on UART_TX correlated to the printstr() functions.

Where does the output from the XTAG-2 XSYS UART_TX pin come into the system...the "proprietary XMOS terminal emulator" connection?

Where do I find the proprietary terminal emulator referred to in the hardware manual?

How does the printstr() get its output back to the console in XDev? Must be through some other part of the XTAG-2 connection/protocol?

I was hoping to see the UART_TX output coming into my console on XDev, but it doesn't. I could remap the UART ports in the demo to an expansion connector port (XD0 and XD1), and connect a USB-Serial there, but seems like I should be able to use this UART_TX within XDev without having to hook up more USB/serial devices to get it.

I'm likely missing something obvious, but don't see it. As always, any pointers would be appreciated,

Landon


User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am

Post by rp181 »

I dont know if this is the proper way, but I did this:

1) Use PORT_UART_TX and PORT_UART_RX, a delay would be helpful
2) Flash the xmos with the program (dont run!)
3) Unplug the XMOS
4) Plug in the XMOS. The flashed program should run
5) In a serial viewer, open (on linux, dunno on windows) /dev/ttyUSB1 (or USB0)

This i where I can get my data to show. This is on Archlinux with an XC-1A. As soon as you do something in the XMOS Dev Enviorment, it takes control, and /dev/ttyUSB0 and /dev/ttyUSB1 are "unmounted".

Makesure you have a ftdi driver, which is usually standard. if not,

Code: Select all

sudo modprobe ftdio_sio
I don't know if this a work around or intended use.
User avatar
landon
Experienced Member
Posts: 71
Joined: Mon Sep 06, 2010 4:05 pm

Post by landon »

Interesting. Thanks for the procedure.

I'm still wondering how the printstr() characters get through JTAG to the XDev console. If the printstr code is available, I'll look at it, too.

thanks for your response.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Be careful Landon

If you are using the XK1 with an XTAG2 it will be different to rp181 setup. The XC-1A (used by rp181) uses an FTDI based usb->JTAG this includes a virtual serial port over usb, hence his recommendation of using /dev/ttyUSBx . The Xtag 2 however provides no such virtual port feature. The xtag2 does however have a demo uart receiver that can be loaded onto it so it can receive from the uart pins, but this is proprietary to xmos and is not a virtual com port. I also cannot for the life of me remember where it is on the Xmos site, anyone have a link?

*Update Here is a reference to previous convos about this

regards
Al
User avatar
landon
Experienced Member
Posts: 71
Joined: Mon Sep 06, 2010 4:05 pm

Post by landon »

Thanks, Al. Looks like I have some reading to do but also looks like the answers to the questions may be in there.

Would be nice for XMOS to document the basic connections like this in a formal way - perhaps in an XTAG2 specific document that could be referenced from their dev kit tutorials.

Thanks for your response with more information on the topic. I appreciate it,

Landon
fulc_mt
Junior Member
Posts: 4
Joined: Wed Apr 21, 2010 10:29 am

Post by fulc_mt »

I'll introduce "How do I get UART output from XK-1".
*It's NOT supported by XMOS.

I got 921600bps UART output.
It's nice for debugging of 2-axis Inverted Pendulum.
Cause program doesn't stop until 'printf'.

This movie shows debugging it with XDE & 'TeraTerm'.
XDE doesn't print debugging messages on XDE's console.
http://www.youtube.com/watch?v=jttndBSrXnM