Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 4th November 2009, 03:54 PM   #1
Default "Shift1 System" drives LCD from 1 PIC pin

Here's something I have been working on recently. It's a simple system using 2 timed RC networks and a latched shift register (74HC595) to give 7 latched digital outputs from timed pulses sent by 1 PIC pin. The concept is open source as are the schematics.

I have supplemented that with full Mikro C source code (again open source), so it's as easy to use as any bit banged serial library. The beauty is that only one cheap logic chip and 2 resistors and 2 caps are needed to drive a text LCD from a single PIC pin. So it can pretty much turn any LCD into a "serial" LCD.







Here is the prototype running a 16x2 LCD from 1 PIC pin;



The full system with schematics etc can be seen here;
Shift1 System for 1-wire Shift Registers


I have also designed a neat little PCB that contains the Shift1 system and also has room for a PIC 12F675, so it can be used for many control and display applications (it just plugs on the back of an LCD);



Also check at the bottom of that page, there is a link to a page with 4 open-source projects I've just released using the PIC 12F675 and Shift1-LCD system;

* Clock 12:00:00 (can be adapted for timers)
* RC Servo tester controlled by pot, displays actual pulse uS
* Solar charge controller, shows battery volts, controls charging
* Tacho shows lathe or drill RPM and an averaged RPM
Mr RB is offline  
Old 4th November 2009, 04:31 PM   #2
Default

Very cool.
Russ Hensel is offline  
Old 4th November 2009, 04:34 PM   #3
Default

NICE!!!!!!!!! dude this is cool. I am going to print this out heh
So basically the cap charging time stops the pulse from hitting something else correct? heh i dont know but it seems complex and very cool. Great job
AtomSoft is offline  
Old 4th November 2009, 05:22 PM   #4
Default

Very nice implementation, presentation, and product Roman...
Mike, K8LH is offline  
Old 4th November 2009, 09:44 PM   #5
Default

Great! This is, perhaps, the best serial LCD I've seen. Have to try this one out right away.
Thanks Roman!
BeeBop is offline  
Old 5th November 2009, 04:45 PM   #6
Default

Quote:
Originally Posted by AtomSoft View Post
...it seems complex and very cool...
It's a old principle (EDN Article "RC Filter Expands Microcomputer Output Port") that Roman has managed to evolve to a whole new level...
Mike, K8LH is offline  
Old 5th November 2009, 05:36 PM   #7
Default

Roman,

Would you mind a suggestion? You might consider bringing out four or five of the latch outputs on the board for use as keypad row or column drivers like I do with my novelty "Breadboard Buddy" 1-pin LCD interface.


You can set those latch outputs any way you want and use them for driving a keypad as long as don't toggle the '595 output connected to the LCD 'E' pin. The additional functionality provides a lot more capability for those little 8-pin (or other) PIC projects.

May I ask if you considered using different RC values for a shorter RC time constant? I ask because I thought that extra '595 output might be kind of handy to drive a small piezo speaker which is pretty much a standard item on all my projects but then I realized that the time required to send a byte to the '595 (approx. 600 to 800 usecs) to toggle the speaker would limit me to a tone no higher than about 800-Hz. Are shorter RC time constants more difficult to work with on this project?

Kind regards, Mike
Attached Thumbnails
"Shift1 System" drives LCD from 1 PIC pin-k8lh-12f635-lcd-interface.png   "Shift1 System" drives LCD from 1 PIC pin-ezlcd-project-example.png  
Mike, K8LH is offline  
Old 5th November 2009, 05:54 PM   #8
Default

I hadn't seen that 2007 EDN article. I did know of some hobby people using an RC network on a shift register back in the old days (talking about the '90s) but there were some issues because of the lack of latching meaning it was only good for LED mutiplexing and some non-critical tasks and it was chip specific because not all of the manufacturers made logic chips that had reliable schmidt threshold voltages etc, some were prone to latchup or erratic operation.

Before I got too deep into this project I did some testing on new HC series CMOS and found the HC CMOS schmidt threshold voltages to be reliable and the inputs extremely resistant to latchup even with slow changing input voltages. Modern logic chips are so far advanced from the old things of 10 or 15 years ago! The HC series have great schmidt inputs.

So it's a combination of an old idea, plus some excellent modern shift registers and a bit of creating and experimenting thrown in...

And thanks people for the nice words!

PS. I've added a temperature controller to the Shift1-LCD Projects page too.

(edit)I just saw your last post Mike. It's an interesting idea, I hadn't really imagined connecting a 4x4 keypad to the thing, the PCB was designed to be little and cheap for making little controllers and "smart displays" etc. But now you said it, a 4x4 keypad could be connected to the 4 LCD data pins (D4-D7) and to 4 inputs of the 12F675.

You can make the time constants shorter, but the values I chose were to make the shortest pulse 1uS, which is usable on 12F675 (or any PIC) on 4MHz osc speed. That was a deliberate design factor. The 1:20 ratio of the two different time constants were chosen for max reliability, I wanted large safety margins around the timed values that work so it would not be fussy to use.

I tested on the finished hardware and many of my time constants (shown in green on the picture above) can be shortened a lot especially the recovery times. But 3 to 4mS to send a character is acceptable, there's not much to be gained by reducing that to 2.5mS or even 2mS. Data reliability is important, I set one up sending characters and commands to the LCD with no breaks (about 320 per second) for a full day, about 10 million bytes sent with never a glitch. You know if you get a glitch on a command as chars will be in the wrong spot or it will corrupt the whole display etc.

As for the speaker etc, since the 12F765 only needs 1 pin to drive the LCD and backlight, there are 3 to 5 pins still availble for things like that.

Last edited by Mr RB; 5th November 2009 at 06:12 PM. Reason: addition
Mr RB is offline  
Old 6th November 2009, 09:34 AM   #9
Default

Today I had a think about your question again Mike, you are right in that the spare pin (ie LCD backlight) can be driven quicker. I missed that in my hurried 4am post above.

To change the backlight bit, you only need to send 3 bits then the latch pulse;
E -> RS -> backlight -> Latch pulse.
E should be a 1 bit (so LCD is not affected), then RS can be a 1 to save time and then the bit to control the spare (backlight) pin. The latch pulse period and it's recovery period can be reduced quite a bit too based on my tests.

I think you could get the total time to change the "spare" bit down to 400uS or so.

That would make it usable for many other control tasks where I originally had just thought about using it for a backlight control. Thanks for that.
Mr RB is offline  
Old 19th November 2009, 03:16 PM   #10
Default

I like your method more and more as I think about it. Simple, elegant, intuitive, absolutely brilliant!!! Lots of possibilities and much quicker overall load times if you don't have to worry about strobing one of the outputs.

Kind regards, Mike

Attached Thumbnails
"Shift1 System" drives LCD from 1 PIC pin-rb-shift1-7-segment.png  

Last edited by Mike, K8LH; 19th November 2009 at 03:21 PM.
Mike, K8LH is offline  
Old Yesterday, 10:17 AM   #11
Default

Very nice diagram Mike! And thanks for mentioning my name on the picture, I feel honoured.

Just remember that the last bit shifted in will have to be a 0 bit due to that being the latch pulse. I assume that's why you have the QA pin of U1 shown not connected. That's a nice setup, it's efficient because you can shift all 47 bits in nice and fast then just do one final latch pulse to latch all 6 IC outputs.
Mr RB is offline  
Reply

Tags
drives, lcd, pic, pin, shift1 system

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
"mplab" + "pic assembly languag"e + "c++" = i need help !!! kira_kame Micro Controllers 11 6th April 2009 07:14 PM
while(feet!=wet) { search(friendly="Linux", hardware="avr", software="kde desktop");} FirefighterBlu3 Micro Controllers 6 12th September 2008 06:31 PM
LCD backlight control during PIC "sleep" Andy_123 Micro Controllers 9 21st March 2008 04:21 AM
"Dead PIC pin" jeg223 Micro Controllers 9 15th November 2007 09:22 PM
Need schematic of a "Miniature digital pin number lock"... chunei Micro Controllers 15 3rd August 2007 06:02 PM



All times are GMT. The time now is 06:42 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker