News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Drive a 2x16 LCD with only one pin of the microcontroller

Started by Moscrash, Feb 03, 2021, 07:24 AM

Previous topic - Next topic

See_Mos

Yes, I found some .INT files in some old backup folders.  I compared them to .INC files of the same name and they look the same.

I just downloaded the zip file.  Unzipped it to my usual PDS\user\ folder and both .BAS demo programs compiled OK.

Just make sure that Shift_Print.inc is in the same folder as the .BAS code.  That way the .BAS is accessing the associated .INC and not some other version.

If that fails then what version of the compiler are you using?

dr-zin

Hi See_Mos (nice handle BTW),
 
Tried again; still the same 20 ASM compile time [113] errors.

I'm using Loader version 3.5.0.6 and Compiler version 3.7.3.6  No, I'm not using the ancient version that predates the DIM command (remember "Name var byte" instead of "Dim Name as Byte").  :D  Thanks for asking though.

I do have a few dozen 74595's that I'd like to use, but I don't consider this a deal breaker; it's just as easy to use a cheap PIC as a multiplexer on an LCD header board and just send 1-wire (really two  ;D) serial commands to it from the main controller (a DIY serial backpack, if you will).  Using a PIC to relay commands and massage output vs. a TTL chip is not terribly different or more expensive in the big scheme of things.  After all, I tried for 4 years to get the Fuse Configurator to work properly for me, then just gave up and resigned myself to memorizing the codes for the various oscillators and options that I use.  I don't like being adaptable, but I will if I have to...

Thanks for your interest and help.  Cheers.

See_Mos

Very strange!

Did you try the code that Pepe posted?

dr-zin

OMG, it worked!  Thanks for the extra prod.
I had tried the one line change from his previous post, but did not download his copy.  It made all the difference.  Guess I'll be laying out a PCB for a 74hc595 this weekend?  At least that's something I can do well.  Thanks again and have a great weekend.  :)

GDeSantis


MartinB

#25
Hi Everyone.
I stumbled across this (now quite old) thread and it piqued my interest and I wonder if anyone would be interested in the results of a bit of development I've undertaken.
This is a neat method of driving LCDs when using low pin-count PICs but it is rather slow at about 3ms/byte - about 50ms for a whole 16-character line.
Roman Black mentions in his article that it may be possible to speed it up and I've looked into doing this and it seems that a significant improvement can be made with some simple changes to both the circuitry and to Les's code.
As can be seen from the circuit diagram I've changed the values of the Rs and Cs present in the original circuit and added two diodes and a resistor, Riso.
The new value for the Cs is chosen to permit COG/NPO components as they have the best tempco & tolerance. Riso is present to provide a degree of isolation between the PIC's output pin and the capacitive loading. This allows it to rise quickly at the end of the bit-time and thus provide a clean SHCK pulse...see Trace1 in the oscillogram.
The circuit values have been chosen to take advantage of the chip's logic input thresholds and so allow (visibly) significant 'dips' in the DIN waveform. These can be seen in Trace2 (which shows the signal present at the STCK pin on a 74HCT595) but provided these dips remain above the logic-high threshold, the circuit operates as desired.
The schematic gives suggested component values and software delay times for both the 74HC595 and the 74HCT595 devices. The HC595 is easier to find but the TTL level input thresholds of the HCT version allow for a somewhat faster data rate.
Simulation runs using Les's original code and the two modified versions indicate the following 'byte-send-times' for the three options:-
 Standard:    3200us
 74HC595:    490us
 74HCT595:  280us
-------------------------------------------------
Oops!
I unintentionally posted this before adding the attachments - sorry. See my next post.
Why do NASA use Assembler?  Because it can shrink Space and Time!

MartinB

I don't know what I did wrong but my previous post "just posted itself" before I had added the attachments. Anyway, here they are...I hope that it worked OK.
Why do NASA use Assembler?  Because it can shrink Space and Time!