musaplayer + sorsat <--- might not work, development needed
C64 LCD DRIVER <--- includes basic and m/l listings
LCD PICTURES <--- some pictures
Search a HD 44780 compatible LCD screen. This code is tested with 16x2 lcd, but any size from 4x1 to 40x2 should work. This code does not support more than two lines.
Create the connection as follows:
Lcd power and gnd from 5v and 0v, respectively. Standard LCD has them on pins 1 as GND and 2 as 5v. Connect these to userport lines 1 and 2, where 1 is gnd.
Connect R/W-line of the LCD with a short wire to GND. We do not need to read from the LCD, and who wants to use such a slow interface for 80 byte memory expansion anyway? We can just wait enough time to get the data written to LCD.
Connect a 10 k potentiometer between 5v and 0v lines, and the middle pin of pot to pin 3 of the lcd. Sometimes you can just ground the line 3 (VO).
Connect pins 11-14 (Lcd data 4 to 7) to pins C-F in userport (PB0-PB3). Also connect pin 4 from LCD to pin H in userport (PB4), and pin 6 (LCD E) to pin J (PB5). When looking from back of the computer, pin C is third from left and on underside of the motherboard. After datapins, next is the R/S line and then the E pin.
Connect the user port connector to c64, and turn power on. After most of the smoke has disappeared, check out the wiring and change the 6526 in the system. If no smoke comes out, and the c64 starts normally, we can try to program the lcd. Adjust the contrast as needed so that you can see something from the screen. This connection also works just fine with a c128.
Basic listing to test out the LCD:
15 input "give text";a$
1000 rem lcd init
Type in the program and save it to disk or tape. After save, run the program. The text you input should come on your screen, but also on the lcd screen. If nothing happens, there is something wrong with your connection.
If nothing comes on the screen, type:
Then use a multimeter with volt setting and check pins D0-D4, R/S and E. They all must now show 0 volts. Then type:
Now the pins should show close to 5 volts (it might be around 4.5 to 5 volts).
Now read the value from 56577 with:
It should respond with a 255. After that type
and after peeking 56577 it should also respond zero. If not, you have a faulty CIA chip or faulty LCD. If the reading becomes correct when you remove the LCD, then you have a short somewhere and sweat on your forehead.
Zip has files:
driver.a LCD driver source code for machine language. Format is ACME
driverold.a LCD driver under development for interrupt.
Lcdbasicdemo.prg Basic program to test LCD (same as listing)
lcdbastest2.prg Basic program that uses ”lcdtest” binary.
lcddriver compiled machine language from driverold.a
lcdtest and lcdtest.prg driver.a compiled binary
listing1 lcdbastest2 text source
listing2 lcdbasicdemo text source
labels compiler label listing
ALL OF THE CODE LISTED ON THESE COMMODORE PAGES AND THIS DOCUMENT IS LICENSED UNDER GPL 2 OR LATER. http://www.gnu.org/licenses/gpl-2.0.html