-
15. Re: EEPROM Interface
DaKn_263916 Feb 10, 2013 7:19 AM (in response to userc_42486)1 of 1 people found this helpful -
16. Re: EEPROM Interface
DaKn_263916 Feb 10, 2013 8:29 AM (in response to userc_42486)1 of 1 people found this helpfulOn second look SDCARD as a byte write memory may not be approach.
You need to acquire sampes at a rate of 8500 SPS ~= 100 uS/byte which is too
fast for byte write speed of SDCARD.
You could use a ping-pong approach, 2 buffers in RAM, one active gathering samples, the
other full from prior gather and being written to SDCARD, say 1KB each. Max speed of write
for SDCARD,to write1K samples, is ~ 36 mS, compared to 1K samples to gather which is ~
118 mS. So record 1KS in buffer A, then switch to B and start recording while writing buffer A
to SDCARD, repeat this loop. So switch between buff that is being recorded/buff being written
back and forth.
You can do the calculations for smaller buffer size, to see if that works out.
Regards, Dana.
gather 1000 samplesin RAM
-
17. Re: EEPROM Interface
helic_263931 Feb 11, 2013 9:01 AM (in response to userc_42486)1 of 1 people found this helpfulIf you only need intermediate storage, you might also use a serial sRAM. Microchip has 1 MBit ones available (e.g. 23LC1024: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en559066 ). They follow basically the same protocol as the serial EEPROMs, but are much faster. And they have no limits on how often you are allowed to write (and they don't need to be erased before one can write).
-
18. Re: EEPROM Interface
userc_42486 Feb 12, 2013 6:09 AM (in response to userc_42486)hi hli,
Can we use Flash Meomory in place of EEPROM to increase Size of SRAM.
Regards
PRP
-
19. Re: EEPROM Interface
DaKn_263916 Feb 12, 2013 6:44 AM (in response to userc_42486)1 of 1 people found this helpful"Can we use Flash Meomory in place of EEPROM to increase Size of SRAM."
SRAM is a single cycle R/W memory. Has no lifetime limit on R/W cycles
FLASH, EEPROM is a 20 mS write speed technology. FLASH specs written
aorund 100,000 erase cycles. EEPROM 1,00,000 erase cycles
You could substitue FLASH if you an live with slower write speed and limited
erase lifetime.
Regards, Dana.
-
20. Re: EEPROM Interface
userc_42486 Feb 12, 2013 8:43 AM (in response to userc_42486)Hi,
uint16 ADC_Samples[ ];
int16 ADC_Sample_Index = 0;
writeStatus = EEPROM_1_Write(ADC_Samples[ADC_Sample_Index++], 0);
ERROR: .\main.c:108: illegal pointer conversioni got the following error, but given in data sheet is cystatus EEPROM_Write(uint8 * rowData, uint8 rowNumber) , which is not matching with uint16 ADC_Samples[ ]; , the ADC here is 14 bit . So is there any way to overcome this problem.
-
21. Re: EEPROM Interface
helic_263931 Feb 12, 2013 9:42 AM (in response to userc_42486)1 of 1 people found this helpfulYou can type-cast the pointer:
writeStatus = EEPROM_1_Write((uint8_t*)ADC_Samples[ADC_Sample_Index++], 0);
(did not try to compile it, though). Note that this call always write 16 bytes of data into the EEPROM. You might want to use EEPROM_ByteWrite() instead.
-
22. Re: EEPROM Interface
DaKn_263916 Feb 12, 2013 9:54 AM (in response to userc_42486)1 of 1 people found this helpfulAre you trying to write individual samples or a whole row of samples ?
You use either
cystatus EEPROM_ByteWrite(unit8 dataByte, uint8 rowNumber, uint8 // to write a byte at a time, so would take 2 writes
or
cystatus EEPROM_Write(const uint8 * rowData, uint8 rowNumber) // to write a whole row, row size is
CYDEV_EE_BASE The base pointer of the EEPROM memory
CYDEV_EE_SIZE The size of the EEPROM memory space in bytes
CYDEV_EEPROM_ROW_SIZE The size of a row of the EEPROM in bytes
So there are several ways to write the EEPROM
Regards, Dana.
-
23. Re: EEPROM Interface
DaKn_263916 Feb 12, 2013 10:07 AM (in response to userc_42486)1 of 1 people found this helpfulhli had a small typo in write, should be -
writeStatus = EEPROM_1_Write((uint8 *)ADC_Samples[ADC_Sample_Index++], 0);
However, row method wastes memory if you are not writing a whole row's worth of samples. In other words, if ROW is 16 bytes, write 8 A/D samples would be optimal.
Regards, Dana.
-
24. Re: EEPROM Interface
userc_42486 Feb 12, 2013 10:12 AM (in response to userc_42486)hi hli, dana,
the following error came ERROR: .\main.c:108: 'uint8_t': undefined identifier , here i am writing sample by sample from ADC to EEPROM.
copy of code
----------------------------
if (ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_WAIT_FOR_RESULT))
{
/* Get the result */
ADC_Current_Sample = ADC_DelSig_1_GetResult16();
ADC_Sample_Available = 1;/* Testing for sample available from the ADC */
if (ADC_Sample_Available)
{
ADC_Sample_Available = 0;
/* storing the sample into the array, based on the index */
ADC_Samples[ADC_Sample_Index++] = ADC_Current_Sample;
// EEPROM INTERFACE//
writeStatus = EEPROM_1_ByteWrite((uint8_t*)ADC_Samples[ADC_Sample_Index++], 0);
ADC_Sample_Max = 0;
for (i = 0; i < ADC_Sample_Index; i++)
{
if(ADC_Samples[i]>ADC_Sample_Max)
{
ADC_Sample_Max=ADC_Samples[i];
}-----------------------------------------------------------------------
-
25. Re: EEPROM Interface
userc_42486 Feb 12, 2013 10:25 AM (in response to userc_42486)Hi hli, dana ,
i am unable to resolve the problem,i am attaching the bundle_minimal.and i am doing on PSoC 3 ES2, Creator 2.0 version.
-
GLCD TEST.cyprj.Archive01.zip 341.2 K
-
-
26. Re: EEPROM Interface
DaKn_263916 Feb 12, 2013 11:00 AM (in response to userc_42486)1 of 1 people found this helpfulIn my prior post, change
writeStatus = EEPROM_1_Write((uint8_t *)ADC_Samples[ADC_Sample_Index++], 0);
to
writeStatus = EEPROM_1_Write((uint8 *)ADC_Samples[ADC_Sample_Index++], 0);
Regards, Dana.
-
27. Re: EEPROM Interface
userc_42486 Feb 12, 2013 11:14 AM (in response to userc_42486)Hi dana,
i have changed to writeStatus = EEPROM_1_Write((uint8 *)ADC_Samples[ADC_Sample_Index++], 0); , but not working.
Regards
PRP
-
28. Re: EEPROM Interface
DaKn_263916 Feb 12, 2013 1:24 PM (in response to userc_42486)1 of 1 people found this helpfulI compiled OK, but had to change -
uint16 ADC_Samples[ ];
to
eg. give it a size.
Also I used Creator 2.2, and had to change silicon to non ES2. Lastly
I also updated a number of modules at request of Creator, normal for
using a later version of Creator.
Regards, Dana.
uint16 ADC_Samples[ 16 ]; // Not sure what size you intend
-
29. Re: EEPROM Interface
DaKn_263916 Feb 12, 2013 1:25 PM (in response to userc_42486)1 of 1 people found this helpfulBlasted forum software screwed up post.
change -
uint16 ADC_Samples[ ];
to
uint16 ADC_Samples[ 16 ];
Regards, Dana.