I will explain it in a metaphorical way. There are many SBC(Single Board computer) using different MCU. Some use PIC, some use AVR and some use propeller chip. SOme SBC using AVR called themselves arduino while some may call SK18C or SK40C which uses PIC. And different MCU has different instruction sets. So here we have 3 things: SBC, MCU and instruction sets. A SBC using AVR cannot execute PIC instruction, right?
It is the same with GLCD, there are different makes of GLCD like TG12864 (made by company X) or my WG12864A (by company Y). The TG12864 uses ST7920 (display chip) while my WG12864A uses KS0108. The ST7920 and KS0108 executes different instruction sets.
So you see, The TG12864 is equivalent to an SBC, the ST7920 is like MCU while the driver is similar to instruction sets in the above metaphor. There's nothing confusing about. Now you want to use the KS0108 driver/library for your GLCD which uses a ST7920 is like saying "Can I use the a program written for PIC and run it on the arduino ?"
Alright. I got that!
Does the sample source code for PR21 work? i tried to build in the MPLAB, it stated build failed with the error -------------------------------------------------------------------------------------------------------------------------------------
Debug build of project `C:\Users\Wong\Desktop\TRy\PR21.mcp' started.
Language tool versions: mpasmwin.exe v5.30.01, mplink.exe v4.30.01, mcc18.exe v3.30
Preprocessor symbol `__DEBUG' is defined.
Wed Mar 02 23:35:07 2011
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\MCC18\bin\mcc18.exe" -p=18F452 "D:\FYP\Cytron\DIY Project Set - Gaming with Accelerometer\Source Code PR21\PR21.c" -fo="PR21.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
MPLAB C18 v3.30 (evaluation)
Copyright 2000-2009 Microchip Technology Inc.
Days remaining until evaluation becomes feature limited: 60
D:\FYP\Cytron\DIY Project Set - Gaming with Accelerometer\Source Code PR21\PR21.c:1:Error: syntax error
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Users\Wong\Desktop\TRy\PR21.mcp' failed.
Language tool versions: mpasmwin.exe v5.30.01, mplink.exe v4.30.01, mcc18.exe v3.30
Preprocessor symbol `__DEBUG' is defined.
Wed Mar 02 23:35:11 2011
----------------------------------------------------------------------
BUILD FAILED
so how should i correct this error?
Thank You!