Hi,
I am trying to get a ATMega8 and ATTiny26 to communicate over a two wire bus but can't get it to work properly. At this stage all I am trying to do is get the ATTiny26 (Slave Rx) to acknowledge the ATMega8 (Master Tx). I either get NACK back at the Mega8 status register or 0x00 (bus error) depending on what I do. I have looked at the signals with a CRO and am confident it is not a hardware problem.
I have been stuck on this problem for 2 days now and I am just going around in circles. I have rewritten it so many times I have lost count.
This is what I have at the moment. It is based on the C code in AVR312 application note from Atmel.
Please, can someone who is familiar with this system show me the error of my ways :)
Regards -Mike
This is the USI setup routine:
SetTWISlave: sbi PORTB,SCL sbi PORTB,SDA sbi DDRB,SCL cbi DDRB,SDA ldi sTmp1,(1