Tempermental LCD response

harolds1956

New Member
Hi, just started using a picaxe 08M feeding a Wulfden K107 LCD controller board and a standard 2x16 LCD. Below is the simple program that's producting inconsistant results.

start:
pause 1000
high 1
begin:
pause 1000
serout 1, t2400, ("hi")
pause 1000
serout 1, t2400, ("?f ")
pause 1000
goto begin

Most of the time the word "hi" flashes on and off. About 30% of the time I get "h", "i", or "hihi". I've tried different pause times, letters, and numbers but the results are the same. Any ideas on what is wrong?
 

westaust55

Moderator
Not sure that I have a solution to your problem but:

1. It is good to post a link to the items you are querying about. In this case: http://www.wulfden.org/downloads/manuals/K107manual.pdf

2. Good practice as per the READ Me First thread at the start of the active forum to wrap your code in the [code] and [/code] markers (in GO Advanced mode use the has key (#) on the format bar at the top of your edit window)

3.Good pracice to get into is to indent your code with only labels starting at the left most colum. You example is small but makes looking for labels easier

4. Now to the code. This may not help but in your posted code you have a space after the "?f" - what if that space is removed.


The PH Anderson examples do not have that space: http://www.phanderson.com/lcd106/lcd107.html
SerOut 0, Baudmode, ["?f"] ' clear the LCD​
and
SerOut 0, T2400, ("?f") ' clear the LCD and home the cursor​


Also, which PICAXE chip are you using? 18M2 for example

I am not aware of any timing isues with that LCD backpack but have you tried using the calibfreq command
 
Last edited:

tracecom

Senior Member
I tried your code exactly as you have it written and it runs on my 08M2 and Wulfden K107.

It displays "hi" in the upper left portion of the screen for 1 second.
The display is cleared and remains blank for 2 seconds.
On the second loop and all subsequent loops, it leaves one blank in the upper left corner of the screen and then displays "hi". I believe that is the result of the extra space in the clear screen command as noted by westaust55. When I eliminate that extra space, "hi" is always in the upper left corner with no space before it.

The "flashing" you report is normal if the flash rate is 1 second on, 2 seconds off because that is what your code calls for. I don't think the erratic operation you report is a code problem, but more likely a connection problem, an assembly problem with the LCD or LCD adapter, or perhaps some hardware problem with the wiring of the PICAXE itself.

If you post a good photo of the hardware and a schematic, that might help with a diagnosis.
 
Last edited:

Texy

Senior Member
Also, which PICAXE chip are you using? 18M2 for example
C'mon Westie - he tells you that in his first sentence.:D
In my experience, intermittant LCD problems such as you describe are usually down to timing issues, ie trying to clock too fast, however that is with parallel interfacing, so is not relevant with serial LCD's (one assumes).

Texy
 

westaust55

Moderator
Aw, don't be mean Texy, Westy has probably been on-Forum for 10 hours ;)
Nah Dippy, more like the Alzheimer's - cannot remember the first sentence by the time I read the last part.
10- hours no way! well I did log in at ... um .. er ... I forgot when :eek:

After all the title is temper-mental LCD response :)
 

harolds1956

New Member
Okay, so here is what I did to try and figure out what's wrong:

removed my picaxe prtotype board and ran the Wulfden board in test mode. While I didn't stare at the display it seemed to run the test program okay.
I then hooked up my prototype board,ran the same code but with different output pins, and 08m's. Even tried different prototype boards,,,,, same results.
Then I ran a different program without using the ("?f") command (see below)

start:
pause 1000
high 1
pause 1000
begin:
serout 1, t2400, ("X")
pause 1000
goto begin

so I would start the program, the lcd would clear and then "X" would display and then another untill the screen would fill up. I would power down the picaxe then power up and the process would repeat EXCEPT that about 30% of the time a new "X" would not show up when it should, like the line "serout 1, t2400, ("X")" would be ignored untill the next loop. Tried wiggling wires while running but it hade no effect.

Should note that I have run complicated programs with stepper motors using my picaxe boards for days on end without missing a beat, so I have to believe my boards are dependable.
Any thoughts?
 

jtcurneal

Senior Member
I tried both your programs and let each of them run for an hour or more without the problems that you have been discribing.

My setup is

PicAxe 08 proto board with a PicAxe 08M
Wulfden K107 serial board with a 2400 baud chip
2 x 20 LCD, backlight not turned on
3 used AA batteries putting out about 4.4 volts

No problems with have shown up with my setup over a 3 hour period

Joel
 

harolds1956

New Member
You mean m4 or m8? Tried that but same results.

Doing alot of trial and error and here is what I found:

-the command ("?f") works about 70% of the time but ("?f?f?f") works 100%, ("?f?f") works about 95%.

-if I use ("?f?f?f") and program to display "77777777777777777777777777777777" I then get a full display from my 2x16 lcd perfectly without missing a beat. I've used a variety of numbers and other charactors with perfect consistant results. HOWEVER if I try to display "XXXXXXX" then its hit and miss. I get "XXX", "XXXXX","XXXX" with no detectable pattern. Seems anytime I introduce a letter anywhere in the program I get mixed , inconsistant results. Seems really bizarre to me.
 
Last edited:

Paix

Senior Member
If I'm not mistaken, then Eclectic seems to be suggesting that with an incremental speed discrepancy, you are more likely to notice errors on series of characters that have spacing elelements towards the end of the transmitted/received character.

Imagine Start smsmsmsm Stop is likely to have a greater chance of erroring (framing errors) than Start smsmmmmm Stop. Where a holding mark is the idle condition
Start mmmmmmms Stop is as likely to be wrong as the first example.

If the receiver is slower relatively than the transmitter, then a sequence of characters at machine speed has little hope of resychronising once a framing error occurs unless characters with marks in the end are received in which case the marks may be interpreted as stop bits and the next character begins apparently at the correct point in the cycle.

Sorry if this seems like a little bit naive to some, but it's surely the way it is with serial comms be it ASCII or Murray code that is being used, exacerbated as the code is longer and the stop bits shorter i.e. 2, 1.5 or 1.
 

jtcurneal

Senior Member
You said that if you put your K107 in test mode, it seems to work ok.

Have you changed the jumper on the K107 board and used " Serout 1, n2400, ("Hi") " bypassing the level shifter"
Maybe you have a bad solder joint in the area of the serial input to the K107.

What are you using for a power supply on your setup?

Joel
 

harolds1956

New Member
Tinkering with the calibfreq command fixed the strange symptoms. I first set at "0" (probably default) and got the same results I have been getting. No surprise here. Setting @ "1" allowed my programs to run perfectly. Increasing to "5" had no change. The manual warns against going past 4. Then I went to "-1" and the syptoms got worse than before I started. Now I'm thinking of going past "5" till it misbehaves then setting somewhere in the middle. Reminds me of adjusting carburators years ago.
 
Last edited:

westaust55

Moderator
Tinkering with the calibfreq command fixed the strange symptoms. I first set at "0" (probably default) and got the same results I have been getting. No surprise here. Setting @ "1" allowed my programs to run perfectly. Increasing to "5" had no change. The manual warns against going past 4. Then I went to "-1" and the syptoms got worse than before I started. Now I'm thinking of going past "5" till it misbehaves then setting somewhere in the middle. Reminds me of adjusting carburators years ago.
Great to read that it is now working.

Adjusting Calibfreq was first mentioned at post 2:
have you tried using the calibfreq command
Comes down to reading all responses not just the last post at a given time.

The reason is as Paix suggests, because of slight timing/speed differnces between the PICAXE and LCD module
 
Last edited:
Top