Send a '.' on TXD every 0.1s. Can use hardware UART as well as software UART.
Test application:
./main.py -b <BAUDRATE>
Note: this can fail if the system frequency is not known precisely enough (if using an internal RC oscillator for example).
- config.h
#ifndef CONFIG_H
#define CONFIG_H
#include BOARD_H
#define UART HW_SWUARTA( txd, DIABOLO_PIN_TX, \
counter, counter0, \
compare, compare0, \
clkdiv, 1, \
autosync, 51, \
fastreg, (shared,gpior0) )
#define BPS 115200
#endif
- main.c
#include "config.h"
int
main ( )
{
bps, BPS,
databits, 8,
parity, none,
stopbits, 1 );
hw( enable, interrupts );
for(;;) {
while ( !
hw(stat,UART).txc ) {}
}
}