[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] TWI hardware hangup issue
From: |
Robert Conger |
Subject: |
[avr-gcc-list] TWI hardware hangup issue |
Date: |
Tue, 17 Feb 2004 18:30:51 -0800 (PST) |
Hi,
I'm new to the list but here goes!
I wrote a TWI interface for the atmega8 uC. I have four of them on a board with
one attached to a line-driver for rs232 output. I found that I can transmit
only once on the TWI before there is an error somewhere in the hardware and
software. When I took a scope to the SCL and SDA lines I found that the Master
Transmitter was transmitting as many bytes as it pleased for the first
transmission but would only get to the start command during the second
tranmission. After debugging with the onboard LEDs I found that the Master
Transmitter would issue a start command but then never continue with the
transmission. I'm using the interrupt driven approach to using the TWI and it's
just a few switch statements and a control structure.
I look around on the list and found someone with a similar problem, but, it
wasn't remedied as far as I could tell. In that instance, several bytes were
being transmitted as individual transmissions and it would hang-up on the
second attempt to send. Looking further I found that the datasheet lists two
possible error conditions on the bus that could cause the hardware to fall into
a non-active state, but, upon testing I found that those states were not
occuring.
Is there anything that needs to be done to the TWI registers between
transmissions? I just had the control register default to having the
TWEN,TWIE,and TWEA bits set. The execution is cyclic so the exact same settings
are used in the first transmission as the second, yet the TWI fails. Any advice
for such a problem?
---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online
- [avr-gcc-list] TWI hardware hangup issue,
Robert Conger <=