WRITING DATA ON EXTERNAL EEPROM VIA HYPERTERMINAL

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

cross mob
Anonymous
Not applicable

I AM TRYING TO WRITE DATA ON EXTERNAL SPI EEPROM VIA HYPERTERMINAL DATA TRANSFER UTILITY.  THE SEQUENCE AS PER EEPROMS DATASHEET IS COMMNAD, ADDRESS, DATA. BUT IN CASE OF FILE WRITING THROUGH HYPERTERMINAL HOW TO DO IT?

0 Likes
18 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Everything is up to you: You will have to specify something like a protocol or file format to transmit to the PSoC5. There are formats like "Intel Hex" that already contain CRC and so guarantee proof-reading of the transmition.

   

So to choose the "best" format and / or protocol it would be advisable to see what information you'd like to transmit and what others have implemented for that purpose so far.

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Breaking down your transmitted format to the sequence: comand, address, data will not be too difficult.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 How do you read the data back? To the PC ? 

0 Likes
Anonymous
Not applicable

 What i mean is do you write it to the eeprom and read it back later. Or the data would be used by the psoc firmware.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

What is the max size of the file transmitted by Hyperterminal ?

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 actually the data is .dat file of 233kB that consist of ascii characters that has to be written to external eeprom via psoc spi.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

File is small enough relative to available SPI speed that a simple

   

protocol of sending entire file and doing a CRC confirmation would be

   

enough.

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I would suggest to send the file in blocks of say, 4 to 16kB. Programming the EEProm takes some time, so the transfer flow must be stopped during that time.

   

Another approach would use double buffering, one buffer where the received data is stored into and another one from which the eeprom gets programmed, both processes running simultaneously.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I stand corrected, for EEPROM I think Bobs approach much more

   

robust. If you were using external NOR FLASH then a fast block

   

page based send of entire file might be simple protocol, but EEPROM

   

write speed contributes to considersation for more complex protocol.

   

 

   

Actually simple protocols lack robustness, but also have less overhead.

   

So you trade off early detection of a fault, for faster overal transfer

   

speed, if, and only if, noise environment a non issue.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Any reason you need to use EEPROM? If you can use flash, most flash has page mode which end up faster then writing EEPROM byte by byte. Of course the write/erase cycle is one of the disadvantage of flash. Also a page mode is good becuase as Bob and Dana suggested, you can do CRC for a page which is more robust. 

0 Likes
Anonymous
Not applicable

 One  more reason for flash is serial flash are very inexpensive comparing with the eeprom of the same size.

0 Likes
Anonymous
Not applicable

 pls also teel me do i need to convert ascii file to hex before writing onn eeprom or can i write on eeprom via psoc spi directly in ascii format from hyperterminal. the size of ascci file is 233 KB buthex file for same is 1.4 MB.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

From the sizes you give us I deduct that what you name an ascii-file is really a binary file which you could burn into your eeprom directly if (I am not familar with that) HyperTerminal does not choke over some binary codes as ^D, ^Z or 0x00.

   

The hex - file you are talking about should be Intel Hex-Format (I mentioned that before) which has the advantages of 

   

-A well defined file-format

   

-CRCs

   

-Readability (you can open with Windows editor)

   

-Containing only ascii-characters

   

Probably you will find some C-language examples to convert intel-hex to binary which you will program the EEProm with. Additionally afaik there is (already) a protocol defined for communication between a PC and a programmer (your PSoC) using Intel Hex-Format. Give google a try with "intel hex converter" or  look at http://www.analog.com/static/imported-files/application_notes/AN-1074.pdf

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I got the small text window again. But it changed to big window while I am typing ????

   

 

   

Have you consider just send the bin file. Which is the raw data only. 

   

However it would be better if you can specify what is the actual requirment, people here may give you alternative approach

   

quicker.

0 Likes
Anonymous
Not applicable

 When i say actual requirment is 

   

"What needs to be done" NOT "How to do it "

0 Likes
Anonymous
Not applicable

the actual requirement is directc utility of actel fpga's in which .dat file of fpga is stored in eeprom.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

There are several sample projects available, just right-clock on the UART component (in the component selector), 'sample projects'. That should help you in writing a program that receives data over UART.

   

If I understand you right the .dat file is plain binary, right? Hyperterminal cannot handle that, you would need to convert it to some ASCII format first. There are several that you can use, e.g. pure HEX or base64 (or something like s-records).

   

If you use a terminal program such as Tera-Term 8http://ttssh2.sourceforge.jp/index.html.en), you can also use protocols like Z-Modem, that provide higher throughput that pure hex and can do checksumming.

   

Tera-Term also can send a binary file directly, but then your program needs to know (e.g. by a button press or so) when to wait for the transfer to start, and it should know the exact file size beforehand (which I think should be constant in your case).

   

For writing to the external EEPROM: look at the data sheet of it, there it should be explained how to do that.

0 Likes
Anonymous
Not applicable

Would you have more then 1 set of data?

0 Likes