B brodin New Member Dec 1, 2003 #1 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?
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?
B brodin New Member Dec 1, 2003 #2 Think i came up with the answer myself. Guess i have to use byte-size, right? And put 8 bits into each byte, right?
Think i came up with the answer myself. Guess i have to use byte-size, right? And put 8 bits into each byte, right?
kinjalgp Active Member Dec 1, 2003 #3 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.
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.
Nigel Goodwin Super Moderator Most Helpful Member Dec 2, 2003 #4 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? Click to expand... 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.
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? Click to expand... 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.