# Need help with external eeprom

Status
Not open for further replies.

#### low_byte

##### New Member
Hi
I have breadboarded together a simple smart card reader that outputs to a LCD for displaying text stored on the card. I am working with gold cards, (pic 16f84a / eep 24c16) and I have not yet been able to get the pic to read the eeprom. I'm using "busin" to access the eeprom and on gold cards the eeprom clock line is RB5 and data line is RB4. My code is

device=16f84a
xtal=4
dim x as byte
DECLARE SDA_PIN portb.4
DECLARE SCL_PIN portb.5
x=BUSIN %10100001,$0 PAUSE 10 SEROUT portb.7,16468,[$0C]
PAUSE 10
SEROUT portb.7,16468,[x," "]
end

When I run the code all I get is a block char on the display. I'm not sure where to put the value of x on line 10. If I move the x to inside the quotes I get x on the display. I'm only trying to read 1 byte to get things sorted out, and I have info already stored in the eeprom. Would someone who has had some luck with 24c16 eeproms please post a snippet of code to help me get going in the right direction. I'm a newbie so please go easy on me. Thanks...

Status
Not open for further replies.