I have not looked into your timer1 problem yet.
There is the same code for LCD character display both in main.c file and in LCD.c
This may make the Linker confused and complaining, if both files are part of the same MPLAB X project.
For tidiness, LCD code should be removed from the main file,
and existence and properties of available functions
explained to the compiler by prototype declarations like:
// Here are prototype declations for functions provided in file LCD.c
These might be typed directly in main.c, but is better placed in a header file, LCD.h
which may then be #included both in main.c and in LCD.c, and in any other file where it may be needed.
See attached file, remove the extra .txt, it is there because of limitations in forum or firewall.
About using PIC18F45K20 with a character LCD display:
There may be a limitation that this microcontroller type is not allowed to be powered by voltage exceeding 3.6 V
while most character LCD display need at least 4.5 V for the LCD panel to show any text.
The Display Controller in the module, Hitahci HD44780 or compatible will work with supply voltage 3.3 V or even lower.
But display panel will need VEE
pin to be VDD
- 4.5 V, which vill require a negative voltage if VDD
supply is 3.3 V.
Some display modules have provisions for this, or a charge pump may be arranged.
Or a 1.5 V battery may be used for VEE
, aka. Contrast pin.
Powering the Display module with +5V, and the microcontroller with 3.3 V may Not be a good solution.
The display controller have internal pull-up circuits on most pins, so may feed current into the microcontroller,
unless voltage translators are inserted.
post edited by Mysil - 2020/12/01 11:48:17