Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20563

AVR-DOS : CF-Cards: AVR-DOS & IORDY ? : REPLY

$
0
0
Hi everybody related to this topic, i struggled a very long time, how to record proprietary raw data, coming with 230400baud from a GNSS receiver ( GPS+Glonass+Beidou) to a CF Card. There where always sporadic some bytes missing and that corrupts the data for post processing. I tried a lot of different ways, to read and write as fast as possible and during my work it has become more and more painful clear that the chaining from sector to sector takes "too much" time and while this sector chaining and FAT update work the USART buffer always becomes a overflow. I checked out that the time of dealing with the FAT, could be from some milliseconds up to approx 200mS in worst case, depending on card size and occupied memory. I tried the common SanDisk CF Cards with 30MB or 60MB /s and i tried also the Hoodman 16GB CF cards with 120MB/s write but that was not the master solution in this application, even because here is noting like UDMA procedure used. So, card performance means not the root of the problem. Any kind of interrupt solutions makes the problem more painful, so i left anything what has to to with interrupts. I expanded the buffer by array, that lowers the amount of missing bytes but has not solved the problem and i tried dozen of different ways to read and write, last but not least using also assembler code for the USART buffer, but i wodered how fast Bascom works, the assembler codepiece within the bascom does not makes a significant faster job than bascom code itself in that loop. So, the read/write code was as fast as possible but the sporadic missing bytes where still present.... More buffer was also no solutio because of the bottleneck, that while the FAT update work blocks the controller, even the controller cannot read data to a buffer. If buffer is max. it means nothing because the controller is busy, not using them and meanwhile the USART input buffer becomes overflow. bascom defined buffer and/or array solutions at all are limited by this issue and the small USART buffer inside the ATMega is limited. Then, one lonely day as i was under the shower, i checked out that i was always focused on my ATMega2561...i wondered why i have never tried to establish a RTS/CTS handshake..... and - that was THE solution. I build up a using a second ABM202 for the RTS/CTS hardware circuit and reconfigured my bascom code and the receiver output. Now, the data was recorded errorfree. WOW! I tried with the speed of 460800baud, the recorded data where still free from any simply missing byte. Conclusion: recording raw serial binary with 460800baud to a CF Card, using AVR-DOS, no problem! For anybody who is interested, please find a code snippet. It may be helpful for those who work on a similar application. best regards Ingolf

Viewing all articles
Browse latest Browse all 20563

Trending Articles