Gast
#1760676
Hi Ich will gerade mein Display von pollin, mit dem sed1520 Controller zum laufen bringen. Schaltung hab ich schon gebaut, nur klappt das programmieren nicht so richtig, da ich eigentlich für den PC programmiere und auf Mikrocontrollerbasis recht neu. Ich möchte mir aber auch nicht durch irgendwelchen Tutorials durchwühlen, wo ich alle Grundlagen noch mal beigebracht bekomme. Problem ist, ich wollte das Display einfach mal in Bascom ansteuren mit Code aus dem Internet. So weit so gut: Aber der Code ist nicht ganz Fehlerfrei. Zumindest fehlen glaub ich ein paar librarys, aber ich weiß nicht welche und anders kann ich mir das nicht erklären. $regfile = "m8def.dat" $crystal = 1000000 ' ***************************************************** $lib "glcdSED1520.lbx" Config Graphlcd = 120 * 64sed , Dataport = Portd , Controlport = Portc , Ce = 4 , Ce2 = 5 , Cd = 2 , Rd = 3 'The dataport is the portname that is connected to the data lines of the LCD 'The controlport is the portname which pins are used to control the lcd 'CE =CS Chip Enable/ Chip select 'CE2= Chip select / chip enable of chip 2 'CD=A0 Data direction 'RD=Read ' ***************************************************** Glcdcmd &H3E , 1 : Glcdcmd &H3E , 2 ' both displays off Cls Waitms 10 Glcdcmd &H3F , 1 : Glcdcmd &H3F , 2 'both on '------------------------------------------------------------------ ' Arbeitsschleife Do Sec_s = Str(_sec) Sec_s = Format(sec_s , "00") Min_s = Str(_min) Min_s = Format(min_s , "00") Std_s = Str(_hour) Std_s = Format(std_s , "00") Portb.0 = Puls If Z1 < 10 Then Setfont Font16x16 Lcdat 1 , 1 , " " ; Std_s ; ":" ; Min_s ; " " , 0 Setfont Font8x8 Lcdat 2 , 98 , ":" ; Sec_s , 0 Lcdat 3 , 1 , " AVR-Praxis.de " Lcdat 4 , 1 , " " ; Date$ ; " " , 0 Else Setfont Font16x16 Lcdat 1 , 1 , "A V R - " , 0 Lcdat 3 , 1 , "Praxis " , 0 Wait 3 End If Loop End 'end program ' ------------------------------------------------------------------ Sectic: Toggle Puls If Z1 < 10 Then Incr Z1 Else Z1 = 0 End If Return ' ------------------------------------------------------------------ $include "font8x8.font" $include "font16x16.font" Das ist der Code vom Avr-Praxis Forum, leicht angepasst. Nur es kommen 2 Assigment Fehler und dass Loop nicht gefunden werden kann, aber das ist wahrscheinlich ein Folgefehler. Die Fehler sind im Anhang. Komischerweise konnte ich die Fehler auch nicht durch auskommentieren beheben. Falls ihr mir doch ein Tut vorschlagen wollt: Ich werde in Zukunft eh in C dann programmieren (das kann ich dann auch), aber ich find es einfacher den Display AVR in Bascom zu schreiben. Achso noch was, ich glaub ich brauch die Fonts noch, wo bekommt man die her?
