I've got two completely unrelated questions for you all:
1. What is the corelation between HEX file size and the program mem usage
on the PIC? Is it file size / 2 like I suspect? Can you get the compliler
to spit out stats like those shown at the end of Microchip's source code
in their application notes?
2. I have a Seiko L2432 2 x 24 char LCD module, which I am having some
difficulty getting a decent contrast out of. I am using what appears to be
a fairly standard usage of a 10k trimpot to control the LCD drive voltage
(pin 3) however the best contrast occurs when this is fully turned towards
the ground side. When I connected ground straight to the pin the display
was slightly darker but still not upto what I would consider to be a
reasonable standard. Anyone have any ideas?
Yes, I do not have the datasheet of this display but a lot of similar
displays need a negative voltage for good contrast , most will take a pot
between -5 and +5 volt
A .HEX type file is an ASCII coded binary file, each byte of machine code
takes two ASCII codes to define (one for each nibble), there is also a
little overhead for things like checksums and addresses etc. but generally
the file is a little over twice as big as the corresponding binary file.
You can look at a .hex file using any text editor and see how the data is
arranged, usualy the last 2 digits at the end of each line are the
checksum byte.
On Wed, 22 Sep 1999, Wesley Moore (Yallara) wrote:
> I've got two completely unrelated questions for you all:
>
> 1. What is the corelation between HEX file size and the program mem usage
> on the PIC? Is it file size / 2 like I suspect? Can you get the compliler
> to spit out stats like those shown at the end of Microchip's source code
> in their application notes?
At 20:28 22/09/99 +1000, you wrote:
>I've got two completely unrelated questions for you all:
>
>1. What is the corelation between HEX file size and the program mem usage
>on the PIC? Is it file size / 2 like I suspect? Can you get the compliler
>to spit out stats like those shown at the end of Microchip's source code
>in their application notes?
The HEX file size is quadruped the program memory used plus 13 bytes
additional
bytes per each 8 words of program memory (Rule of thumb). This calculates
to over
5.5 times the size for the hex file.
Add to this 47 bytes for ID plus 17 bytes for the config word.
> I've got two completely unrelated questions for you all:
>
> 1. What is the corelation between HEX file size and the program mem usage
> on the PIC? Is it file size / 2 like I suspect? Can you get the compliler
> to spit out stats like those shown at the end of Microchip's source code
> in their application notes?
>
No, it's not size/2 because although each byte is represented by as ascii
hex, i.e. 2 characters, this dosen't take into account the header strings
and the checksum. I've sent you a hex to bin utility off-list which will
convert an intel hex file into absolute binary. Because the size of the
PICs word is 12 to 16 bits, two bytes per word are used so if you divide the
resulting binary filesize by two, you will get the correct result.
Note that if config bytes are included in the hex file then it will be
slightly too large...not sure of the exact figure though.
> 2. I have a Seiko L2432 2 x 24 char LCD module, which I am having some
> difficulty getting a decent contrast out of. I am using what appears to be
> a fairly standard usage of a 10k trimpot to control the LCD drive voltage
> (pin 3) however the best contrast occurs when this is fully turned towards
> the ground side. When I connected ground straight to the pin the display
> was slightly darker but still not upto what I would consider to be a
> reasonable standard. Anyone have any ideas?
>
> Wesley Moore
>
Some displays (mostly extended temperature types) need a negative voltage on
the contrast pin. Check the specs of your display to see what the minimum
voltage allowable on the pin is. You can generate a negative voltage from a
simple charge pump driven from e.g. a 555 timer or use one of the special
purpose -ve voltage generators.
Wesley, about the LCD, some LCD's actually take a negative voltage on the
contrast pin - you'll have to check the specs to find out (hitachi driven
displays normally don't). If the display is just too light, this may be the
problem. You should be able to adjust the cotrast to the point where
everything is black. In the case of large displays with a low duty cycle per
line this may mean that the display is actually more grey than black. Also
try is with the backlight on - sometimes makes a huge difference..
> I've got two completely unrelated questions for you all:
>
> 1. What is the corelation between HEX file size and the program mem usage
> on the PIC? Is it file size / 2 like I suspect? Can you get the compliler
> to spit out stats like those shown at the end of Microchip's source code
> in their application notes?
>
> 2. I have a Seiko L2432 2 x 24 char LCD module, which I am having some
> difficulty getting a decent contrast out of. I am using what appears to be
> a fairly standard usage of a 10k trimpot to control the LCD drive voltage
> (pin 3) however the best contrast occurs when this is fully turned towards
> the ground side. When I connected ground straight to the pin the display
> was slightly darker but still not upto what I would consider to be a
> reasonable standard. Anyone have any ideas?
>
> Wesley Moore
>
Come to think of it maybe the 555 idea is more 'within specs' of the LCD
module. Where can I get an example of this configuration, the data sheets
don't appear to include it.
> > I've got two completely unrelated questions for you all:
> >
> > 1. What is the corelation between HEX file size and the program mem usage
> > on the PIC? Is it file size / 2 like I suspect? Can you get the compliler
> > to spit out stats like those shown at the end of Microchip's source code
> > in their application notes?
> >
> No, it's not size/2 because although each byte is represented by as ascii
> hex, i.e. 2 characters, this dosen't take into account the header strings
> and the checksum. I've sent you a hex to bin utility off-list which will
> convert an intel hex file into absolute binary. Because the size of the
> PICs word is 12 to 16 bits, two bytes per word are used so if you divide the
> resulting binary filesize by two, you will get the correct result.
> Note that if config bytes are included in the hex file then it will be
> slightly too large...not sure of the exact figure though.
>
>
> > 2. I have a Seiko L2432 2 x 24 char LCD module, which I am having some
> > difficulty getting a decent contrast out of. I am using what appears to be
> > a fairly standard usage of a 10k trimpot to control the LCD drive voltage
> > (pin 3) however the best contrast occurs when this is fully turned towards
> > the ground side. When I connected ground straight to the pin the display
> > was slightly darker but still not upto what I would consider to be a
> > reasonable standard. Anyone have any ideas?
> >
> > Wesley Moore
> >
> Some displays (mostly extended temperature types) need a negative voltage on
> the contrast pin. Check the specs of your display to see what the minimum
> voltage allowable on the pin is. You can generate a negative voltage from a
> simple charge pump driven from e.g. a 555 timer or use one of the special
> purpose -ve voltage generators.
>
> Mike Rigby-Jones
>
On my web page, I give a small example circuit of an inverting charge pump
that you could use to achieve ~-4V with more than enough current to bias
the LCD. Unfortunately, I do not show the 555 part in the circuit,just the
diodes and caps. All you need is ANY low to medium-current pulse source, in
addition to the diodes/caps shown on my page. You could even just pulse one
of the PIC pins and use that. The rate would not be critical for this app,
even 30Hz would be fine,as would anything up to about 50kHz.
It's the second circuit down,but the info from the one above it applies,too
(voltage doubling charge pump).
Sean
At 02:01 PM 9/23/99 +1000, you wrote:
>Come to think of it maybe the 555 idea is more 'within specs' of the LCD
>module. Where can I get an example of this configuration, the data sheets
>don't appear to include it.
>
>TIA
>
>Wesley Moore