This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Programming to external EEPROM

Hello. I need some help.
I'm trying to write, read and erase an external EEPROM (25AA040 MICROCHIP) via SPI from XC164CS board, for example, one byte at 0x00 adress of the eeprom, but i don't know how to do it.
Into the datasheet, I can see some instructions but i don't know what to do with them:
img28.imagevenue.com/img.php
Could anyone help me?
Thank you very much. :)

Parents
  • Hello,

    Starting from the infineon spi eeprom example, what would be the easiest way to use it in polling? I thought that I might just disable the PEC interrupts, wait for an interrupt request flag, clear it and if it's the receive one, execute the code extracted from the former receive interrupt routine and repeat this until the eeprom is released. Would that make sense?

    void SSC0_Polling(SPI_DEVICE_TYPE dev)
    {
            while( SPI_Dev_Busy(dev) )
            {
                    if(SSC0_TIC_IR == 1)
                    {
                            SSC0_TIC_IR = 0;
                    }
                    if(SSC0_RIC_IR == 1)
                    {
                            SSC0_RIC_IR = 0;
                            SSC0_Rx_Interrupt_Routine();
                    }
            }
    }
    

    Thank you!

Reply
  • Hello,

    Starting from the infineon spi eeprom example, what would be the easiest way to use it in polling? I thought that I might just disable the PEC interrupts, wait for an interrupt request flag, clear it and if it's the receive one, execute the code extracted from the former receive interrupt routine and repeat this until the eeprom is released. Would that make sense?

    void SSC0_Polling(SPI_DEVICE_TYPE dev)
    {
            while( SPI_Dev_Busy(dev) )
            {
                    if(SSC0_TIC_IR == 1)
                    {
                            SSC0_TIC_IR = 0;
                    }
                    if(SSC0_RIC_IR == 1)
                    {
                            SSC0_RIC_IR = 0;
                            SSC0_Rx_Interrupt_Routine();
                    }
            }
    }
    

    Thank you!

Children
No data