[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] Atmega165 USI I2C (TWI)
From: |
Joerg Wunsch |
Subject: |
Re: [avr-chat] Atmega165 USI I2C (TWI) |
Date: |
Fri, 22 Jul 2005 23:07:28 +0200 (MET DST) |
Grant Elliott <address@hidden> wrote:
> 3) Removed the __x from the declaration of
> USI_TWI_Start_Transceiver_With_Data. Honestly, I don't even know
> what __x does, but AVR GCC didn't like it.
Even the IAR docs does not document that. I grepped their supplied
header files, and could not find any plain __x declarations but __x__z
declarations. This looks like it might somehow magically trigger
special handling for some of the pointer registers (X and Z). I'd
suggest you bug avr -at- atmel -dot- com for that, after all, they
wrote that code. ;-)
> 4) Commented out the lines that set SCL and SDA as outputs. With
> them present, the lines don't pull high as expected after
> initialization. Further, an attempt to use the transceiver stalls
> because the lines never change state.
Hmm, SCL and SDA aren't plain outputs (all the time) but are normally
supposed to be active-low (i.e. open drain) outputs that work against
external pull-up resistors. I didn't look at their code, but these
pins IMHO need to be changed between output and input frequently if
there's no open-drain hardware implementation available.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)