We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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