Use each bit of 24C16?!

Status
Not open for further replies.

brodin

New Member
I want to be able to address each bit in a 24C16.

I am using PicBasic Plus 2.1.

Usually i use these 3 subs:

MemWrite:
GoSub GetPos
BUSOUT control_byte, address_low, [Utdata]
pause 10
Return


MemRead:
GoSub GetPos
busin control_byte,address_low,[Indata]
pause 10
Return


GetPos:
control_byte = $A0 + (MemPos.highbyte << 1)
address_low = MemPos.lowbyte
Return



But now i want to be able to access each bit, one and one. Is that possible?
 
Think i came up with the answer myself. Guess i have to use byte-size, right?

And put 8 bits into each byte, right?
 
Yes thats correct. The bits in 24Cxx EEPROMs are arranged in group of 8-bits. So whatever operation you do is in terms of bytes and not bits.
 
brodin said:
Think i came up with the answer myself. Guess i have to use byte-size, right?

And put 8 bits into each byte, right?

Yes, but it's easy to do bit wise reads and writes, simply read the entire byte - to write, manipulate the bit you want, and write the updated byte back - to read, simply test the bit you want.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…