Hi We need your help in our design. Our application is to read data from a hex file, manipulate it and send result to one of the I/O ports. We have written the manipulation code. We would like to know how to access the hex file from our code. Is there a way to know the address of our hex file or some file operation methods? Also how to store the program hex file and our hex file on the ROM. WE are using 80C251TB or C167CR-LM. Thanks and regards Rajesh Chavan,
There is not enough information in your question. Where is the hex file? Is it on a PC? If so, what form of connection are you wanting to use between the PC and the C167? Is the data to go out the I/O port as fast as it can, or do you want some sort of handshaking between some other device and the C167? Give the group more info and I bet someone's done something like what you want to do before.
Thanks for the prompt response. here are more details. We have a hex file created from external source. This file is the configuration data from a SRAM based device(FPGA). We want to store it on the uc ROM, access it in our uc code for manipulation and then send some results to one of the I/O ports (These are connected to the configuration pins of FPGA). The problem is firstly storing the hex file on ROM along with the code and then accessing it in our code. Now , we dont know if we can program the uc such that we can specify a ROM address for our hex file and then access that address in the uc code. Or is there a way to access the file using filename? I hope this gives a better idea of our problem. Thanks and regards Rajesh
I have a C167 connected to a DSP. The DSP linker creates a mfg formatted hex file. I wrote a short application to parse the hex file and create a text file containing the C declaration for a const array initialized with my hex file data. This file is "included" in one of my ".c" files and becomes a variable in the ROM which can be accessed as any other C variable. I send this hex data to the DSP as part of my initialization by reading the array in "C". It seems like this should work for you. The disadvantage is of course that if the FPGA code changes you have to do another build of the C166 stuff.
Thank you very much for the suggestion. It has worked perfectly to solve our problem. We are using this method to use the ethernet connectivity of 167 for dynamic reconfiguration of FPGA and also to save on extra external SPROM for storing the configuration data. thanks and regards Rajesh