PIR1bits.SSPIF=0;i2=SSPBUF; //workaround for rev3 erratafor(SSPBUF=receive_buffer[++RXptr];!PIR1bits.SSPIF;); //writefor(i2=PR2>>1;i2;i2--); //workaround for rev3 errata
Ok, so you are already modifying the firmware; it was not clear at all.
The first step is to understand what new instructions you want to implement.
I assume you need to send a configuration to the shift registers: that's one.
Then in order to transfer data from the memory you can use the READ_B.
Now you have to shift to the control software and write the correct sequence of instructions.
For example:
-set the shift register configuration a certain amount of times (I am not familiar with the memory, it may be that you just need to set the address).
-read B port via READ_B.
Repeat for every address.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
it's c code the program is picc knon as ccs
output_high/low do? = example port B0 go high 1 go low 0
got it working i receive from eeprom exact 64 byte.
i changed the function output expander wih this
define DataPin output_bit
define ShiftClockPin output_bit
define LatchPin output_bit
void ShiftOut(int8 data)
{
ShiftClockPin(PIN_B1, 0); //default clock low
DataPin(PIN_B2, 0); //default data low
LatchPin(PIN_B0, 0); //default latch low
unsigned char bitcount = 0; //init bit counter
for(bitcount = 0; bitcount < 8; bitcount++) //send 8 bits
{
DataPin(PIN_B2, 0); //assume MSB = 0
if(data & 0b10000000) //if MSB = 1
{
DataPin(PIN_B2, 1); //send 1
}
ShiftClockPin(PIN_B1, 1); //strobe clock
ShiftClockPin(PIN_B1, 0);
data = data << 1; //left shift data bits
}
LatchPin(PIN_B0, 1); //strobe latch
LatchPin(PIN_B0, 0);
}
im 50year age :)
now i need function to receive all eeprom content, like your function in ccs:
if !defined(SW_SPI) //hardware peripheral
else //software mode
endif
if !defined(SW_SPI) //hardware peripheral
else //software mode
endif
Ok, so you are already modifying the firmware; it was not clear at all.
The first step is to understand what new instructions you want to implement.
I assume you need to send a configuration to the shift registers: that's one.
Then in order to transfer data from the memory you can use the READ_B.
Now you have to shift to the control software and write the correct sequence of instructions.
For example:
-set the shift register configuration a certain amount of times (I am not familiar with the memory, it may be that you just need to set the address).
-read B port via READ_B.
Repeat for every address.