LCD - Hippy's (modified) code

knight

Member
Good evening all,

Its been a while, but good to be back.

I had an opportunity to finally finish a project (LCD serial/I2C interface board) I had got printed, but never got to finish, and its not behaving quite as well as I would like (which I think might be a serial issue, but thought I'd throw the question out to those more knowledgeable than I)

The interface board uses Hippy's LCD interface code and acts as a serial/I2C wrapper around it and the code can be found here..no wait...attached...its too long.

Now the reason I say its behaving funny is because it works - sort of....

When I apply power it runs through the initialisation code, and as expected finishes by displaying:
Code:
[color=Red]"LCD Firmware"[/color]
[color=Red]"Version .5"[/color]
And it does this over two lines, exactly as expected.

The problem is when I try to go from there.
I tried connected the download cable to the hserial port - no response. Slight modification, yep can receive correctly, but no response when I send anything.

Okay fine, modify the Main routine to simulate hserial using the serrxd, this time it triggers the interrupt, but instead of displaying my text, it filled the screen with a random shape. However, baud and polarity seem to be correct because I'm correctly receiving the "Serial" notification. I tried sending both control characters and regular ASCII, still nothing.

Knowing my luck, its simply because I'm using the serial monitor from the editor, but I thought someone might see something I've missed.

Thanks in advance for the help everyone.
 

Attachments

hippy

Ex-Staff (retired)
Do you have a link to the original code, and does that work ?

It is a little difficult to tell what has been modified and what has not. The modified code seems to accept serial in from the download interface, via background serial receive and act as an I2C slave. Unfortunately I do not recall the context for the original code so it is difficult to know what it should be doing, how it should be used.
 

hippy

Ex-Staff (retired)
Having re-read the original post; it seems you may have only used the LCD interfacing code. The rest, the serial and I2C interfacing and handling code is all new, original code.

I am not sure what the problem is, but if the intro text is appearing it would seem the LCD interface and driving software is working correctly, that would suggest it is in the serial or handling code.

I would recommend starting with simpler code, start with just a program which receives serial data, extracts the data and sends that back, get that working as expected first. Don't include the LCD routines at all or the various other modes of input. Get each part working separately then start from one, add the LCD code, then add the other receive modes.
 

knight

Member
And in a brilliant example of:

!!!!ALWAYS CHECK THE SIMPLE THINGS FIRST!!!!

If you are trying to do Hardware Serial and your input pin is B6, setting Port B to 01011111, may make your serial comms hard to do......



Yes I set my serial input pin to be an output, which is why the interrupt wasn't work because, well, the chip wasn't expecting to hear anything on an output pin....
Ho hum :p
 
Top