At 05:40 PM 3/1/2005, Ivan Vernot wrote: >David, >Now you have me intrigued... ;-0) It really is very weird what you are >experiencing.... > >A few (long shot) things to try (I hope I don't offend) > >1. _How_ are you certain that it is the USART1_TX ISR that is firing? (As >opposed to anther ISR that calls the same handler. or that it is calling a >handler that you _think_ is the TX ISR? The vector I showed is where the ice takes me when I single-step through it. >2. Is it possible that one ISR is 'falling through' to the TX ISR? (ie a >forgotten 'reti'?) You couldn't get to the vector table that way. One ISR to another, yes, but not the vector table. >3. Can you put a break point in the TX ISR using JTAGICE and THEN examine >the UART registers (ie. is the TXC1 bit in UCSR1A set? Yup. Breakpoint, or single step, the USART regs say it's disabled, and the ints are disabled. UDRE is set, but you'd expect that. >4. In your startup code try to clear any pending interrupts in ICSR1A >before you enable the global Int Flag. (NB that to CLEAR the Int pending >flags you need to write a 1 not a 0.) No, but that would only explain the first one. I get them over and over again, about every 6 uS (8 MHz system clock) >5. As an experiment, can you setup the UART with 'real' values (ie. rather >than just clearing the regs to zeroes) and actually try to TX on it. Then >explicitly disable the TXE and RXE bits? I don't know what that will prove >but it might be interesting to see if you can tx on that uart at all? >(?faulty part) or that somehow the UART is getting confused by a zero >baudrate (for eg.) I tried a non-zero baud before, had the same thought, but I'll give it a shot. >6. Try to clear the TXC1 bit in UCSR1A in your ISR and see if the repeated >INTs stop. Yes I know that the flag _should_ be cleared when the TXC IST is >completed but... I've tried that in code, and in the ICE, no help. >7. Try Anther chip :-( Hmm.. I only have three of the 128Ls in hand. This is a 3V app. >8. Try running the software without any debug (ie jtag etc) - again a long >shot, but something to try to see what happens. It's int'ing. I have a pin ping on an unused pin, that tells me when this happens. >I'm not sure if any of this helps but I have been using the Mega128 for a >couple years know (with both UARTS) and have never seen anything that weird. Me too! That's why it's bugging me so. >Please let use know how you get on. >Cheers (or not ;-)) >Ivan Vernot Thanks, I'll give that a shot and see what happens. Something's not right, that's for sure.
Message
Re: [AVR-Chat] Prototypitis
2005-03-01 by Dave VanHorn
Attachments
- No local attachments were found for this message.