Can't seem to get the RX FIFO on UART0 to work... My setup: U0IER bit 0 =1, Enabled RDA interrupt (receive data interrupt) U0IER bit 1 = 1, Enable THRE enterrupt (transmit data interrupt) U0IER bit 2 = 1, Enabled the Rx line status interrupts U0FCR bit 0 = 1, Enabled both RX and TX FIFOs U0FCR bit 7:6 = 3, Rx trigger level of 14 chars The TX and RX interrupts work it's just that RX interrupts immediately after receiving a character. I'm running at 38.4k baud and I'm getting an interrupt every 286uS which is the char time at this baud rate. I'm expecting to not interrupt until 14 characters have come into the buffer. Any ideas or anyone else having this same problem? Thanks, Jeff. -----Original Message----- From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of embeddedjanitor Sent: Monday, May 02, 2005 1:37 PM To: lpc2000@yahoogroups.com Subject: [lpc2000] Re: What's Best Way to Globally Disable Interrupts --- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> wrote: > At 07:30 PM 5/2/05 +0000, kaiandxiulpc2000 wrote: > >If my user application is running with interrupts occurring, then I > >need to disable all interrupts for a bit of time: > > > >1) Should I use the C command "VICIntEnable=0x00000000"? > >OR > >2) Set the IRQ and FIQ bits in the cpsr? Also, then do I have to be > >in > >non-user mode (i.e. privileged mode) to enable/disable the IRQ/FIQ > >bits > >in the cpsr? > > In my opinion number 2 will cause you the least problems. In fact I would > disable interrupts before modifying VICIntEnable. And yes you have to be in > a mode other than user mode. On the other hand there is no reason to be in > user mode anyway. The only thing that distinguishes user mode from system > mode is that in user mode is that in user mode you cannot set and clear the > interrupt enable bits. Agree. Look back for postings on spurious interrupts. Fiddling with the VIC is not enough. > > Personally I prefer a disable/restore interrupt pair rather than a > disable/enable interrupt pair. There is an implementation of the former in > the newlib-lpc library that should be easily separable from that library if > desired. Agree again. restoring allows you to restore the previous state (ie. you should not always blindly turn interrupts on). Restoring allows you to use the same code in an interrupt or normal context etc. I use two funtions intGetDisable() and intEnable() int intval; // previous interrupt value intval = intGetDisable(); // Is the interrupt enabled? Disable if it is enabled; // protected code if(intval) intEnable(); ________________________________ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/lpc2000/ * To unsubscribe from this group, send an email to: lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . [Non-text portions of this message have been removed]
Message
LPC2138 RX FIFO (not)
2005-05-02 by Lowry, Jeff
Attachments
- No local attachments were found for this message.