Loading ...
Sorry, an error occurred while loading the content.

Re: [booksbybibin,www.booksbybibin.tk] Atmega to 45DB161 Interface

Expand Messages
  • ankit pandoh
    first try interfacing SPI with ur microcontroller.if it is working properly then go ahead
    Message 1 of 2 , Sep 28, 2008
    • 0 Attachment
      first try interfacing SPI with ur microcontroller.if it is working properly then go ahead

      On 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??
       
      ldi Temp,0b10111111
      out DDRB,Temp ; PB - all output except MISO input

      ldi Temp,0b01011100
      out Spcr, temp ; Enable SPI, device master,  

      ldi temp,$9F ; code to get device ID
      out spdr, temp

      Wait_Transmit:
      sbis spsr,spif
      rjmp Wait_Transmit

       


    Your message has been successfully submitted and would be delivered to recipients shortly.