Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
rogersan Regular Member Joined: 10/04/2015 Location: AustraliaPosts: 79
Posted: 02:49pm 10 Sep 2015
Copy link to clipboard
Print this post
I have an 5 volt LCD display connected to a micromite, pins 3-7 of the micromite driving d4-d7 of the LCD, pin 7 driving RS of the LCD, and pin 9 driving E of the LCD.
I am using LCD INIT 3,4,5,6,7,9 to initialise, and LCD 1,1,str$("text") to drive the display.
It all works OK, but occasionally the LCD goes blank. You can force this blanking to happen by plugging and unplugging the USB connector (at the PC) of my USB to serial converter. I tried pull up resistors to 5 volt on the RS and E lines to the LCD, in case there was noise getting into these lines, but no improvement.
I am monitoring the program loop by flashing an LED, and the program is still going, so my watchdog is not operating to trigger a program restart.
Has anyone found a problem like this?
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9644
Posted: 03:04pm 10 Sep 2015
Copy link to clipboard
Print this post
Interesting.
Which MM are you using?
170 or 470?Smoke makes things work. When the smoke gets out, it stops!
rogersan Regular Member Joined: 10/04/2015 Location: AustraliaPosts: 79
Posted: 03:55pm 10 Sep 2015
Copy link to clipboard
Print this post
I am using the 170.
If I put an LCD CLOSE and LCD INIT 3,4,5,6,7,9 in the program loop it fixes the problem but should not be necessary.
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9644
Posted: 04:51pm 10 Sep 2015
Copy link to clipboard
Print this post
Acknowledged. I will hook up and LCD later today, and see if I can reproduce the problem. I have not noticed anything like this with LCD's before, but it could be a well-hidden thing...
I agree - you should not need to close and re-initialize the LCD in a loop.Smoke makes things work. When the smoke gets out, it stops!
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2948
Posted: 08:42pm 10 Sep 2015
Copy link to clipboard
Print this post
Couple of questions:
1> Do you have OPTION AUTORUN ON selected? If so, then are you sure your program is not restarting after a 'power glitch'?
2> Is your PSU able to provide enough current for MM, LCD, LED, and anything else?
Even though it sounds like a software issue (bug?) it is worth checking/confirming the above first
WW
factus10 Regular Member Joined: 30/12/2014 Location: United StatesPosts: 45
Posted: 11:10pm 10 Sep 2015
Copy link to clipboard
Print this post
Are you powering your project from your programming cable? Which version do you have? According to FTDI's site, their 3.3v programmer is only good for about 50-75ma. The 5v can do 450.
All this depends on your design. FTDI cable? Or on board usb to serial? The latter can pick up to 500ma from your computer.
rogersan Regular Member Joined: 10/04/2015 Location: AustraliaPosts: 79
Posted: 04:49am 11 Sep 2015
Copy link to clipboard
Print this post
The project is separately powered from a 5 volt regulated plug pack. The 4 line x 20 character LCD runs off 5 volts, I could not find a 3.3 volt version. There is a linear 3.3 volt regulator running off the 5 volt to power the micromite.
Sometimes when you plug in the USB connector (of the USB to serial converter), the display blanks or glitches with odd characters on the screen. For some reason, I think, connecting the earth of the PC to the earth of the 5 volt plug pack causes a glitch. This could be due to capacitance between the plug pack output and mains power, which is changed when you connect the PC ground to it.
The display can blank occasionally with the USB disconnected, and this is what I am trying to fix. Perhaps there is noise on the 5 volt supply, it must be a switch mode supply as it is a light weight plug pack.
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10406
Posted: 05:14am 11 Sep 2015
Copy link to clipboard
Print this post
Is the USB port direct on the PC? If so the -ve rail on the USB is at earth potential. It sounds like the -ve rail from your regulated power pack may be floating or have a significant common mode voltage. Then when you plug in the USB bad things happenEdited by matherp 2015-09-12
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209
Posted: 05:38am 11 Sep 2015
Copy link to clipboard
Print this post
Matherp, that sound like as good diagnose.
I always struggle with 'earth', 'ground', etc as most of the power packs are not using a transformer anymore to guarantee isolation from the electricity net.
Most powerpacks use 2 pins so they are guaranteed to float.
Connecting them to earth on your computer through your own hardware is a problem i would like to know how to solve.
What i do now is connect the USB but make sure only the gnd and D- and D+ are connected not VUSB that provides power. Then connect the power brick but also leave the + side unconnected by having a switch in the off position.
This should take care of the gnd being a common reference. Then flip the switch to power the project.
This seems to work, but it is highly depended on the sequence of connecting things and disconnecting the usb means doing the sequence from the start, which would reset the whole system.
The prevent all of that i now often use a 6-7V motorcycle battery to power projects in development.
Microblocks. Build with logic.
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10406
Posted: 05:55am 11 Sep 2015
Copy link to clipboard
Print this post
In my experience many of the cheap 2-pin packs float at mains voltage/2. You can get a small electric shock if you touch the "ground" pin until you earth it out