write UART program on XC-3 through XTAG inbulit USB-UART

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
jagspaul
Experienced Member
Posts: 117
Joined: Tue Oct 18, 2011 3:28 pm

write UART program on XC-3 through XTAG inbulit USB-UART

Post by jagspaul »

In XC-3, XMOS pin X0D39 (XS1_PORT_1P) is connected with FTDI 2232 serial Tx (through XTAG) and X0D04 (bit 0 of XS1_PORT_4B) ) is connected with FTDI 2232 serial Rx pin.

To write UART program I used X0D39 as Rx & X0D04 as Tx.
I have no issue with my receiver function as it is using a 1 bit port but I am confuse with transmitter function as it using bit 0 of a 4 bit port.

Please tell me how to send a 8 bit data serially through bit 0 of a 4 bit port.

Please note that I am not using sc_uart module. I use simple code from uart tutorial and have checked & found the receiver part is working fine (In PC side I am using windows Hyper terminal).

Regards
jags


jagspaul
Experienced Member
Posts: 117
Joined: Tue Oct 18, 2011 3:28 pm

Post by jagspaul »

I have done it with use of masking in the 4 bit port.

Hint:
// set bit 0
p <: peek(p) | 0x01;

// clear bit 0
p <: peek(p) & (~0x01);

for reference see my another post "How to mask a port?".

But I must say that I shocked no to see a single reply regarding this issue.

jags
nisma
Active Member
Posts: 53
Joined: Sun Dec 13, 2009 5:39 pm

Post by nisma »

As seen in hw manual, the other pins are not connected or used.
For this reason, why you want read in the bit in this case ?
Use it as 1bit port, only that the significant bit is in bit3 and not bit0.
You can use 0xf or 0x8 or every other constant where bit3 is set instead or shift
the data to 4bit left and use it as 1bit without streaming.
jagspaul
Experienced Member
Posts: 117
Joined: Tue Oct 18, 2011 3:28 pm

Post by jagspaul »

I wants to make it general so that one can use it when no mere i bit port is available and other bits of the 4 bit ports may be sued in other purpose.

jags