Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/19/06 22:59
Read: times


 
#129787 - the nature of the UART/steping through interrupts
Hi-
I've searched the forums here and google, but am having trouble finding a straight answer to my question. My apologies if I've missed it - I'm a newbie! Here goes: I'm unclear as to the nature of the UART on the 8051. I'm currently using a SiLabs c8051f330 (http://www.silabs.com/public/do...1F33x.pdf) According to the datasheet:

UART0 has two associated SFRs: Serial Control Register 0 (SCON0) and Serial Data Buffer 0 (SBUF0). The single SBUF0 location provides access to both transmit and receive registers. Writes to SBUF0always access the Transmit register. Reads of SBUF0 always access the buffered Receive register; it is not possible to read data from the Transmit register.
With UART0 interrupts enabled, an interrupt is generated each time a transmit is completed (TI0 is set in SCON0), or a data byte has been received (RI0 is set in SCON0). The UART0 interrupt flags are not cleared by hardware when the CPU vectors to the interrupt service routine. They must be cleared manually by software, allowing software to determine the cause of the UART0 interrupt (transmit complete or receive complete).

The crux of my question is: is the 8051 UART full duplex? I have the UART connected via RS232 to my PC's serial port and hyperterminal. If I write something to SBUF0 in my firmware, say mov SBUF0, #31h, will I generate a receive interrupt in addition to my transmit interrupt? For example, if I try to echo a characters (eg I type "xyz" in hyperterminal and want to see "xyz" appear on the PC screen in hyperterminal) will I have to disable receiving on the UART while I transmit the characters back to the screen?

I'm using the Keil Evaluation IDE and when I step through my program I can't see when an interrupt trips (I assume it's too fast for stepping through?). Is there a way to configure the IDE to show me when an interrupt flag is set? Thanks a lot for your help!

D

List of 21 messages in thread
TopicAuthorDate
the nature of the UART/steping through interrupts            01/01/70 00:00      
   Uart is full duplex            01/01/70 00:00      
      Thanks Russell            01/01/70 00:00      
   UART Question Part 2            01/01/70 00:00      
      You can not do both            01/01/70 00:00      
         In response to Neil            01/01/70 00:00      
            go with the bit            01/01/70 00:00      
         In response to Neil            01/01/70 00:00      
         In response to Neil            01/01/70 00:00      
            Sorry for teh tripple post...            01/01/70 00:00      
      More...            01/01/70 00:00      
         Search and Read            01/01/70 00:00      
         Thanks Russell            01/01/70 00:00      
         I hope Russell did not lead you down the garden pa            01/01/70 00:00      
            Erik - garden path indeed!            01/01/70 00:00      
               I'm using interrupts            01/01/70 00:00      
   Question about my interrupt driven UART            01/01/70 00:00      
      You know the answer.            01/01/70 00:00      
         Thanks Russell            01/01/70 00:00      
         answer is partially incorrect            01/01/70 00:00      
   Can't single step on UART            01/01/70 00:00      

Back to Subject List