' second test with the Wiznet W7100 Werkt op serial port $regfile = "w7100.dat" $crystal = 11059200 $baud = 115200 Tl1 = &HFC ' 115200 baud Th1 = &HFE Declare Sub Lcd_reg(r As Byte) Declare Sub Lcd_char(c As Byte) Declare Sub Init_lcd Dim R As Byte ' register Dim C As Byte ' character Dim D As Byte ' temporary Dim Tekst As String * 20 ' string tekst Dim Pos As Integer Dim Z As String * 1 Reset P0.1 ' R/w LCD display Reset P0.0 Call Init_lcd Print "Start" Do Set P0.3 Set P0.4 Set P0.5 Wait 1 Reset P0.3 Reset P0.4 Reset P0.5 Wait 1 Print "X"; Loop End Sub Init_lcd Waitms 15 Call Lcd_reg(&H30) Waitms 10 Call Lcd_reg(&H30) Waitms 1 Call Lcd_reg(&H30) Waitms 4 Call Lcd_reg(&H20) Waitms 1 Call Lcd_reg(&H20) Call Lcd_reg(&H80) Waitms 1 Call Lcd_reg(&H00) Call Lcd_reg(&H80) Waitms 1 Call Lcd_reg(&H00) Call Lcd_reg(&Hc0) Waitms 1 Call Lcd_reg(&H00) Call Lcd_reg(&H10) Waitms 1 Tekst = "W7100 and Bascom" For Pos = 1 To Len(tekst) Z = Mid(tekst , Pos , 1) Call Lcd_char(asc(z)) Next Pos End Sub Sub Lcd_reg(r As Byte) P2 = R P0.2 = 1 'toggle E Waitms 1 P0.2 = 0 End Sub Sub Lcd_char(c As Byte) P2 = C P0.2 = 1 P0.0 = 1 Waitms 1 P0.2 = 0 P0.0 = 0 Waitms 1 Rotate C , Left , 4 P2 = C P0.2 = 1 P0.0 = 1 Waitms 1 P0.2 = 0 P0.0 = 0 Waitms 1 End Sub