The code given below with the date from 2013 in the constant string was complied and exectued correctly in Februar 2013. SAB80C535 and LCD Modul in eight Bit Modus.
Today with the changed date for next year the code was compiled and linked witout any error message but does no longer execute properly on the hardware. Either the the display is not initialzied or the float value is not written to the dispaly or the float value is zero.
If the float operations are deleted, the remaining programm is executed properly.
If only sqrt is computed and written to the string, the string is correctly written to the display. All other char strings and their LCD operations deleted.
Compiling is in Large Code and Large Memory Model. Compiler is the same as in February. The SAB 80C535 has 56k external RAM. Hardware the same as before.
No clue what has happend since February. The project is unaltered in folders, projectfile and so on, except for the content of the one constant string with the date. And the length of the string is 19 characters plus /n as before.
#include <reg515.h> #include <lcd.h> #include <math.h> #include <stdio.h> void main(void) { char select; float x; xdata char zeile1[20] = "Berufskolleg Hilden"; xdata char zeile2[20] = " 15. November 2014 "; xdata char zeile3[20] = " Kreis Mettmann "; xdata char zeile4[20] = " IT-Abteilung "; xdata char zeile5[20] = " Mikrocontroller "; xdata char zeile6[20] = " Digitaltechnik "; xdata char zeile7[20] = " Schlüsselverfahren"; xdata char zeile8[20] = " "; init(1,1,0); display_on_off(1,1,0); entry(1,0); home(); clrscr(); lcdadr(0); datschreib(zeile1); lcdadr(63); datschreib(zeile2); lcdadr(20); datschreib(zeile3); x = sqrt(2.0); printf(zeile8 , "%14.6f" , x); do { switch(select % 5) { case 0 : { lcdadr(84); datschreib(zeile4); warte(2000); break; } case 1 : { lcdadr(84); datschreib(zeile5); warte(2000); break; } case 2 : { lcdadr(84); datschreib(zeile6); warte(2000); break; } case 3 : { lcdadr(84); datschreib(zeile7); warte(2000); break; } case 4 : { lcdadr(84); datschreib(zeile8); warte(2000); break; } } select++; }while(1); }
Inhalt von lcd.h
void warte (unsigned int zeit); void init(bit D, bit N, bit F); void clrscr(void); void home(void); void entry(bit ID, bit S); void display_on_off(bit D, bit C, bit B); void datschreib(char *z); void lcdadr(char a7);