maandag 27 juli 2009

Hello world on LCD

Last weekend I was able to display 'hello world' on the LCD screen using the LCD library provided by the Hitec C compiler. This library is for a LCD that uses the Hitachi 44780 controller.

The first attempt resulted in lots of rubbish on the screen. Reseting the processor resulted in different rubbish. It was not 100% rubbish though. Some parts of the words were readable. For example I saw 'wrd' it should have been 'world'. That was interesting, it seemed that some of the characters were skipped. That indicates a timing problem. So I added some additional delays in the Hitec LCD code. This solved the problem.

The code should be independent of the xtal frequency. Apparently it is not. My xtal is 18 MHz the xtal in the Hitec example is 4 MHz. Delays in the code take in account the clock frequency.
However, I found that some operations are not proceeded by a delay. That may be the problem or My LCD is just slow.

Thats good news. The bad news is that 33% of the programming attempts fail. The Winpic programmer frequently reports verification errors. Most errors are at high addresses. My PIC may be unstable. Maybe I 'll buy another one to check.

current activity:
Currently I am investigating the use of the PWM modulator to generate the ramp signal. I found an application note about using PWM as digital analog converter. It would be great to generate the ramp in software.

Geen opmerkingen:

Een reactie posten