Re: [booksbybibin,www.booksbybibin.tk] Atmega to 45DB161 Interface
- first try interfacing SPI with ur microcontroller.if it is working properly then go aheadOn 9/22/08, Moataz Hussein <moatazhussein@...> wrote:I am trying to interface 45DB161D to ATmega 16 using the SPI, I have went through many documentation and material.
My problem is that I am not able to get it work, I started by sending $9F to read device ID.
I checked the program and started debuging it again on AVR Studio, and noticed that PORTB7 (SCK) is not changing instead it is PINB7, aslo the MOSI.
Is there any initilaization missing??
out DDRB,Temp ; PB - all output except MISO input
out Spcr, temp ; Enable SPI, device master,
ldi temp,$9F ; code to get device ID
out spdr, temp