2 This is a sample application for openMSP430 softcore MCU with external HW UART
3 peripheral <git@rtime.felk.cvut.cz:fpga/uart> and quadcount peripheral.
5 First of all "Hello world" is printed and then application works like echo and
6 also prints quadrature count whenever its value is changed (only whole turns
9 Baudrate is set to 115200.
21 inline uint32_t qcount() {
25 result |= ((uint32_t)QCNTH << 16);
31 Handling of QuadCounter IRQ
33 interrupt(QCNT_VECTOR) qcount_isr() {
34 printf("[QCount = 0x%08lX]\n", qcount() >> 2);
39 Print bits of byte in format b'xxxxxxxx'
41 void print_byte_flags(char flags) {
47 for (i = 8; i != 0; i--) {
48 if ((flags & 0x80) != 0) {
65 void delay(unsigned long int a, unsigned long int b) {
79 Main function with init and an endless loop.
83 //UBAUD = 0x04E1; //24.00MHz - 9600 baud
84 UBAUD = 0x0067; //24.00MHz - 115200 baud
86 eint(); //enable interrupts
89 puts("Hello world\n");