Keywords: data logging, flash card, I2C interface, 16-bit I/O extender
|0x02||Sector count||0x06||Select card/head|
Write_MAX7311(slv,prt,dat) This procedure starts the I²C bus and sends data byte dat to port prt on the MAX7311 with slave address slv.The functions above are used to create two other functions, which read and write to the CF card registers:
Read_MAX7311(slv,prt) This procedure starts the I²C bus and reads a data byte from port prt on the MAX7311 with slave address slv.
Write_CF_REG(reg,dat) This procedure uses Write_MAX7311 to place the data dat on port 1. The same procedure is used to place the register address reg on port 2, together with the other control signals. The write is executed three times (toggling WRN) to generate the write signal.The functions available for reading and writing the card registers can now be used to create functions for accessing the CF-card sectors:
Read_CF_REG(reg) This procedure uses Write_MAX7311 to address the CF-card register and generate the read signal. The Read_MAX7311 procedure then reads the data from the register.
Write_CF(cyl,head,sec) This procedure uses Write_CF_REG to designate the target cylinder, head, and sector (registers 0x03 to 0x06) in a write operation. The CF card is then configured for data writing by writing 0x30 to the command register. Write_CF_REG is then executed 512 times to write the data (stored in a global array) to the data register. The CF card automatically adds this data to the current track.If the microcontroller's internal memory is too small for storing 512 bytes of data, you can write the sector from the loop in which the data acquisition is taking place. That is, after receiving each new measured data point, its value can be written to the CF card directly. More specifics on controlling the CF card can be found in the compact-flash specification document available for download from www.compactflash.org.
Read_CF(cyl,head,sec) This procedure uses Write_CF_REG to designate the target cylinder, head, and sector in a read operation. The CF card is then configured for data reading by writing 0x20 to the command register. Read_CF_REG is then executed 512 times to read all 512 bytes from the track through the data register, and to place the data in a global array.
|EE-Mail||Subscribe to EE-Mail and receive automatic notice of new documents in your areas of interest.|
|Download||Download, PDF Format|
|© , Maxim Integrated Products, Inc.|
APPLICATION NOTE 4418,AN4418, AN 4418, APP4418, Appnote4418, Appnote 4418
Unfortunately, we are unable to place your order due to restrictions on your account. Please contact customer support.
Sorry, but we are unable to process sample requests from non-business or non-educational e-mail addresses via this site. Your options are :
Thank you for your interest in Maxim
Thank You for interest in Maxim Integrated. Our free samples program limits the quantities that we can provide to each customer per calendar year.If you feel that you have received this message in error, please contact email@example.com. Alternatively, you can click here to place an order.
|Part Number||Description||Key Advantages|
Are you sure you want to Request Company Account?