- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Breaking down your transmitted format to the sequence: comand, address, data will not be too difficult.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you read the data back? To the PC ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the max size of the file transmitted by Hyperterminal ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
actually the data is .dat file of 233kB that consist of ascii characters that has to be written to external eeprom via psoc spi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One more reason for flash is serial flash are very inexpensive comparing with the eeprom of the same size.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When i say actual requirment is
"What needs to be done" NOT "How to do it "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the actual requirement is directc utility of actel fpga's in which .dat file of fpga is stored in eeprom.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would you have more then 1 set of data?