PDA

View Full Version : Processing lengthy strings



sougata
- 20th March 2006, 17:51
Hi Everybody,

I made a previous post on parsing data from a VT220 terminal @ 9.6kbps. It is basically a POS LED display that shows different items like weight , price , batchcode and other stuff to the buyer. I have used a PIC18F452 and have around 16 Seven Segment Displays(static info) and 16 5x8 LED displays (scrolling info). Now the problem is that with inclusion of new items I need to parse lengthy information from the VT220 terminal. Previously I was using a co-ordinate detect (from the terminal excape sequences ) with known delimiter. Now with the data changing I need to parse lengthy strings (more than 160 characters ) and get valid data out of it. It is not at a fixed co-ordinate so I would not like to loose characters. BTW I am using a 255 bytes ring counter with interrupt based USART read , checks for clearing hardware error, removing esc($1B) done in asm. I am using fast context restore that is Retfie, Fast. But the problem is searching for an entire array of strings takes time in the main routine so I am having flicker in scanning the matrix.(done by polling timer 0 overflow row scanned). I need a better algo, doing a checksum did not solve as the data is different for different item. For example I have to look for "This is a nice forum and I love it and take part actively"
Now I need to find and display I love it on my matrix. I also need the later part to know that I am getting it all right.Since the co-ordinates are not same so cannot just do a length trimming. Thinking of using a separate PIC for the parsing stuff. Any ideas or better algo? I have tried checksum. Works but not perfectly.

sougata
- 21st March 2006, 05:27
Hi,

Rather than parsing the whole data I am now emulating terminal like interpretation right into the ISR, with inbuilt two digit decimal ASCII to binary conversion. This involves getting the terminal co-ordinate data and assigning the real text data into pre-defined arrays rather than one single ring bufffer. I am unsure about my practices with the indirecting file addresing in the asm. Any tutorial or tips on the same would be appreciated. Also please let me know if bank switching in asm ISR is okay. Anyway the FSR values are restored with the Retfie FAST. I am not using any calls within the ISR, rather Goto. I believe this would not modify the shadow registers(only one level deep).

Wish me luck I need it.