??? 10/08/04 15:03 Read: times |
#79034 - RE: Why did you not follow Olegs advice? Responding to: ???'s previous message |
hi,
Let me start from far away. To understand better what happens we need do analyze of the logic. What you do step by step: 1) read 16 chars and put them into buffer; 2) scroll chars in buffer left; 3) read next char and put it at the end of buffer; 4) refresh 16 chars through 7 rows: 4a) convert char to value via charset table; 4b) clock row bits out; 4c) check for return conditions; 4d) set active row and make row strobe; 4e) goto next row from 4b 5) goto step 2. Now see which part of this takes most time? Indeed, you must refresh all these bits and rows and so it may be optimized with assembler but it is not a solution. What is about steps 2), 3) and 4a) ? I see your trouble is that after 7 rows have been refreshed you read next byte from EEPROM. It takes some time and display goes out during it (in fact, the last refreshed row keeps lighting). Try to modify your program with next way: 1) read full message into buffer; 2) convert all chars of the buffer to their values (bitmaps); 3) set scroll pointer to the bitmap of the first char to be displayed; 4) do refresh 16 chars pointed from scroll pointer (shift out, strobe etc); 5) increase scroll pointer +1; 6) goto 4. Indeed, you will need to check for end-of-message condition and moreover: you will need with the big buffer for chars` values (at least number_of_chars x 7 bytes). If you have not enough memory then eject step 2 and convert chars to values inside step 3. General idea is to have all data to be refreshed as ready for use. Another way - obtain next data within refresh time but in your case I doubt that it is possible without timer-based refresh. Regards, Oleg |