Oops!![]()
Bah! Still not having much luck here,
I have the LCD routines working, and changed the LCD_anypin file as follows:
Since I'm only using a single display, hopefully that's all that is needed to enable the E pin for 5us.Code:;===============( DO NOT Change anything below this line )==================== ;----[Virtual LCD Port --- 4bit mode]----------------------------------------- ASM LCD_Port_HNIB macro ; Port definition for LCD High Nibble Vbit LCDCDFLAG, _LCD_RS ; Select Command/Data register Vpin 4, _LCD_DB4 ; Put the High Nibble on the bus Vpin 5, _LCD_DB5 Vpin 6, _LCD_DB6 Vpin 7, _LCD_DB7 PulseLow _LCD_E, 5 ; pulse the Enable Pin for 2 us endm ;----------------------- LCD_Port_LNIB macro ; Port definition for LCD Low Nibble Vpin 0, _LCD_DB4 ; Put the Low Nibble on the bus Vpin 1, _LCD_DB5 Vpin 2, _LCD_DB6 Vpin 3, _LCD_DB7 PulseLow _LCD_E, 5 ; pulse the Enable Pin for 2 us endm ENDASM
Still the display coming on at all after startup is hit & miss.
It seems to come on straight after programming with the pickit2 (when powered by the pickit2,
but doesn't want to come on when powered by any other means (or even by the pickit2 when not being programmed).
Seems the problem is hardware Darrel!
I wanted the pic to be able to switch on & off power to the LCD, so I used a BD649 transistor to switch the ground pin of the LCD display.
The base is connected via 2.2K resistor to a spare pic pin, collector to the LCD ground, and emitter connected to the circuit ground.
Then the idea was to set the pic pin connected to base high, and then wait the "PAUSE 1000" delay time for the LCD to be ready each time I used it.
If I now short the emitter and collector of the BD649 while powering up, the display works every time (with LCD_anypin).
I can then release the short between the transistor pins, and the display stays on! What's happening there?
It's probably become obvious it's for a car circuit.
The idea is to have the LCD (VFD) powered only when the car is started, but the pic circuit should be running all the time.
Maybe ...
If the data/RS/E pins are not tri-stated while the power to the VFD is OFF, it could be trying to power it from those pins.
Then when the transistor turns on, it doesn't activate the power-on reset in the display.
When programming with the PICkit, those pins will always tri-state during programming.
Just turning off the transistor without tri-stating all the pins first may not be enough.
Then remember to clear the FLAGS variable, so PBP will re-initialize the display.
DT
Probably not your problem, but I spent several hours trying to figure out why my one project would work fine after programming (using USB with a bootloader to program) but after a power cycle it wouldn't work. Program it again and it worked fine until I would do a power cycle again. Turns out when I programmed the bootloader into the PIC I had the extended instruction set enabled. Just a thought.
Shawn
Being the self-educated hack-git that I am, I don't know what either of those suggestions actually are.
BUT, being the self-educated hack-git that I am I figured out you can:
Defeat the 24hr Wikipedia blackout by hitting Ctrl-A followed by Ctrl-C
quickly before the blackout screen appears, then you can paste the entire page to Windows Notepad!
I tried to find out what tri state means... Do I need to use transistors to isolate all of the LCD control pins?
How do you reset the FLAGS var? it is an internal asm variable yes?
Will that ruin my program during execution if my own flags have critical states?
@ spcw1234, I'm not using a bootloader, just plain vanilla PBP hex loaded straight to the pic.
Disable java scripting on your browser to use Wikipedia.
http://meta.wikimedia.org/wiki/Engli...ad_blackout.3F
Shawn
Bookmarks