MCF52233 - InterNiche Network Stack running Interupt Driven UART

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF52233 - InterNiche Network Stack running Interupt Driven UART

1,385 Views
wyliek
Contributor I
Hi there
 
Just a few simple questions:
 
I am using the MC52233DEMO board and interniche lite network stack. Using the ColdFire Lite project, I'd like to change the UART to be interrupt driven as opposed to polled....
Is this possible?
Has anyone done this or know of any example code?
 
 
I have commented out POLLED_UART and now the application doesn't work...
 
Thanks
Kyle
 
--
Alban Edit: added device name in subject line

Message Edited by Alban on 2007-03-28 08:34 PM

Labels (1)
0 Kudos
2 Replies

391 Views
Petter_fupp
Contributor I
The INTC0 registers must also contain unique numbers for each interrupt source. This is incorrect in the Interniche code.

Example piece of fixed initialisation stuff (if you are using a RAM vector table):
Code:
// Initialize the UART interrupts.if (portno == 0) {    mcf5xxx_set_handler(0x40+13, (ADDRESS)uart0_isr);    MCF_INTC0_ICR13 = MCF_INTC_ICR_IL(2) | MCF_INTC_ICR_IP(3);    MCF_INTC0_IMRL &= ~MCF_INTC_IMRL_MASK13;} else if (portno == 1) {    mcf5xxx_set_handler(0x40+14, (ADDRESS)uart1_isr);    MCF_INTC0_ICR14 = MCF_INTC_ICR_IL(2) | MCF_INTC_ICR_IP(4);    MCF_INTC0_IMRL &= ~MCF_INTC_IMRL_MASK14;} else {    mcf5xxx_set_handler(0x40+15, (ADDRESS)uart2_isr);    MCF_INTC0_ICR15 = MCF_INTC_ICR_IL(2) | MCF_INTC_ICR_IP(5);    MCF_INTC0_IMRL &= ~MCF_INTC_IMRL_MASK15;}

 

0 Kudos

391 Views
flashtoo
Contributor I
Kyle,
 
The Interrupt driven UART does not work because it is still masked in the IMRL register.  In file mcf5223_init.c it set up the uarts with uart_init(0). This includes tryng to correctly set the IMRL register but the IMRL bit 0 (mask all) is not cleared until a later call to mcf5223_gpio_init(). For a temp fix, I must moved the uart_init(0) to just after the mcf5223_gpio_init()function.  It does not seem clear that the uart init should here in the first place but it needs to be near the top as there is all sorts of debug code that tries to print to the console.
 
Also, do not enable uart1 unless you are using it. It generates undesirable interrupts that I did not have a chance to track down the cause of
 
A word of advice, I have found MANY bugs in the InterNiche RTOS and IP stack. When using it and you find something wrong or not working correctly, don't assume it must be a bug in your code....
 
FlashToo
0 Kudos