25AA320A EEPROM byte write and page write

avreeprom

I need to write data into my external EEPROM 25AA320A using Attiny2313. I know how to write one byte at a time. For example, spieeprom_write (200, 7); with 200 being the starting address on EEPROM, and 7 is the data i want to write into the EEPROM.

my questions are:
1. what is the next address that i can write to?
2. is 7 considered to be a byte?
3. how do i perform a page write? I know one page is 32 bytes for my EEPROM.

Thanks, it would be great if you can provide some examples.

Best Answer

Well, one address generally hold one byte, so if you write to address 200 then the next byte you can write to address 201 and so on.

As for what is considered a byte and what is not, generally the write call only accepts bytes so whatever you give it will be converted to a byte. If the compiler doesn't like that, you will probably get some sort of an error when you compile it. A byte can be either 0 through 255 or -128 through 127.

For writing a page, just write 32 bytes. If you want to use specific page write commands that the chip supports but the library doesn't support, you're out of luck unless you write your own library or find one that does.