
The eeprom i am using is an 25LC640 SPI and I have tested it with a single data store to an address and it works. I canot get the correct result when reading from eeprom Shiftout SI, SCK, MSBFIRST, ' Send write enable command

' Subroutine to write data at addr in serial EEPROM ' Subroutine to read data from addr in serial EEPROM Hserout 'check a/d conversion before writting to mem 'Only PortA.0 analogue input, Vref+ = Vcc, Vref-=Vss 'ADCON1 = 7 ' Set PORTA and PORTE to digitalĪDCON1 = %10001110 'Right Justified result format 'All bytes received, diable address detectionĭEFINE HSER_TXSTA 20h '8 bit transmissionĭEFINE HSER_SPBRG 64 'set USART to 2400 baud (when BRGH=0)ĭEFINE HSER_CLROERR 1 'Enable automatic overrun errorĭEFINE ADC_SAMPLEUS 50 'Sampling time in ìs Master PIC knowing all 3 PIC's have the data swtches into normal operation.Hi! I ve been trying to use an EEPROM to store results from a/d conversion.Ĭan you spot anything wrong with my code?ĭEFINE HSER_RCSTA 90h 'Enable Serial PORT PIC 1 after recognising end code stores received data in an array and sends back confirm to master PIC then goes into normal operation. Master PIC sends start code for PIC3, then data then end code. Master PIC sends start code for PIC2, then data then end code. Master PIC sends start code for PIC1, then data then end code. So the startup procedure would be more like.


Using this method I assume I could just connect all 3 PICS to the serial out side and use a different wait code for each PIC. Another idea I have had which may work better is one master PIC (primarily used for data-logging and display work) which feeds the data from the EEPROM to each of the other PIC's in turn.
