TC1767 / DAvE use/ AT25128 e2prom read&write help me! nn.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Dear administrator

when I Developed controller by XC2265, I used EEPROM which is AT251N.

I had to see the Hot of Traning document (HOT_XE164FM_EEPROM.pdf)

so I used DAVE tool (ver 2.0)

as below


//////////////////////////////////////////////////////
U0C1_SCTRH = 0x0707; // Sets frame length on 2 byte
U0C1_SSC_vSendData1(0x06); // Enables write mode
U0C1_SCTRH = 0x070F; // Sets frame length on 4 byte
U0C1_SSC_vSendData1(0x01); // Sets status register ready to write
U0C1_SSC_vSendData1(0x02); // Resets array adresses protection
while( U0C1_SSC_uwGetData() ) // Waits till writing has ended
{
U0C1_SCTRH = 0x070F; // Sets frame length on 4 byte
U0C1_SSC_vSendData1(0x05); // Reads Status Register
U0C1_SSC_vSendData1(0x00);
}

// Writes data in EEPROM
U0C1_SCTRH = 0x0707; // Sets frame length on 1 byte
U0C1_SSC_vSendData1(0x06); // Enables write mode
U0C1_SCTRH = 0x071F; // Sets frame length on 4 byte
U0C1_SSC_vSendData1(0x02); // Introduction for WRITE

U0C1_SSC_vSendData1(0x02); // Introduction for WRITE
U0C1_SSC_vSendData1(0x00); // Memory of EEPROM
U0C1_SSC_vSendData1(0x00); // Memory of EEPROM
U0C1_SSC_vSendData1(wriValue); // Transmit data
while( U0C1_SSC_uwGetData() ) // Waits till writing has ended
{
U0C1_SCTRH = 0x070F; // Sets frame length on 4 byte
U0C1_SSC_vSendData1(0x05); // Reads Status Register
U0C1_SSC_vSendData1(0x00);
}
…….

U0C1_SCTRH = 0x071F; // Sets frame length on 8 byte
U0C1_SSC_vSendData1(0x03); // Enables read mode
U0C1_SSC_vSendData1(0x00); // Memory of EEPROM
U0C1_SSC_vSendData1(0x00); // Memory of EEPROM
U0C1_SSC_vSendData1(0x00);
U0C1_SCTRH = 0x070F; // Sets frame length on 4 byte
Page 27
U0C1_SSC_vSendData1(0x05); // Reads Status Register
U0C1_SSC_vSendData1(0x00);I recently used documents.
recValue = U0C1_SSC_uwGetData();
////////////////////////////////////////////////////////

we recently used Tri-core 1767.

and we bought Tri-core 1767 EV kit included EEPROM(AT251N).

and we need to use EEPROM(AT251N) working by SPI communication

but we can't working using Existing sources.

we tried to find 32-bit Tri-core register like "U0C1_SCTRH"

but we can't

so please help us.

if you can, would you like to offer source to us.

If hard, please let me know register used to SPI communication
0 Likes
1 Reply
Not applicable
solved solved solved solved
0 Likes