byte ReadRAM(int address) { digitalWrite(Rdpin,HIGH); digitalWrite(ALE,LOW); digitalWrite(ALE,HIGH); DDRC=0xFF; DDRA=0xFF; PORTC=highByte(address); PORTA=lowByte(address); delayMicroseconds(5); digitalWrite(ALE,LOW); delayMicroseconds(5); DDRA = 0x00; PORTA = 0xFF; digitalWrite(Rdpin,LOW); delayMicroseconds(5); z = PINA ; PORTA = 0x00; //High-Z digitalWrite(Rdpin,HIGH); DDRC=0xFF; DDRA = 0xFF; return(z); } // End of READ routine
This is a read routine which works well for arduino .Now i want to use it with P89v51rd2 controller.Plz help me with DDR ,PORT AND PIN FUNCTIONS. I AM NOT ABLE TO FIND alternatives for them. thankyou
ARDUINO MEGA2560
So the specific AVR documentation you require is here:
www.microchip.com/.../ATmega2560
See also:
www.arduino.cc/.../arduinoBoardMega2560