#include #include #include in port p_uart_rx = XS1_PORT_1O; void super_simple_test( port in p_UART_RX ) { unsigned time, i, bit_time,data; unsigned char buf; bit_time = XS1_TIMER_MHZ * 1000000 / 56700U; printstrln("Running super simple UART test..."); while (1) { p_UART_RX when pinseq( 0) :> int _ @ time; time += bit_time + (bit_time >> 1); // sample each bit in the middle. for (i = 0; i < 8; i += 1) { p_UART_RX @ time :> >> data; time += bit_time; } // reshuffle the data. buf = (unsigned char) (data >> 24); printchar(buf); } } int main (void) { super_simple_test( p_uart_rx ); return 0; }