Thank you for viewing my posting.
I am using a PIC16F690 with MPLAB X version 3.45 in assembly language. In my work recently with a LCD (EA DIPS082-HN) I noticed something I had not seen before and wanted to post it here to get some feedback.
What I noticed:
I use PORTC to send my data to the lcd in 4 bit mode and have rs, r/w and e on bits 4,5,6 respectfully. I am using (PORTA) a 5 position joystick tactile switch which allows me to control movement of the cursor and to increment and decrement a number value(0-9) at a ddram address accordingly. I have had no problem writing my assembly line code to do this at one ddram address. I then was able to expand my program to move the cursor between 2 addresses and increment/ decrement a number. I have all of the switch positions debounced in my program. BUT, when I move between the 2 addresses in ddram I am not able to put my saved value (cblock 0x40) that I saved, into the PORTC register, as I move the 0x40 contents into the W reg. and then into PORTC. I actually simulated it in MPLABX and it simulated perfectly but in the actual application it gives me garbage and shifts the lcd, cursor, etc.. Now if I replace that line in (putting the 0x40 contents into W then into PORTC) my code with a hex or binary value placed into the w register and then into PORTC I get correct results.
I need to store the value that will go into PORTC in a variable location (because it changes depending on user input) and need to then place it into the PORTC.
I do not think that this is a read-modify-write common problem but I have never seen my situation before. Has anyone seen this before, and is there a way for me to do what I want possibly another way? I also tried using the FSR/ INDR indirect addressing but had the same negative results.
Thank you for your future help.
P
I am using a PIC16F690 with MPLAB X version 3.45 in assembly language. In my work recently with a LCD (EA DIPS082-HN) I noticed something I had not seen before and wanted to post it here to get some feedback.
What I noticed:
I use PORTC to send my data to the lcd in 4 bit mode and have rs, r/w and e on bits 4,5,6 respectfully. I am using (PORTA) a 5 position joystick tactile switch which allows me to control movement of the cursor and to increment and decrement a number value(0-9) at a ddram address accordingly. I have had no problem writing my assembly line code to do this at one ddram address. I then was able to expand my program to move the cursor between 2 addresses and increment/ decrement a number. I have all of the switch positions debounced in my program. BUT, when I move between the 2 addresses in ddram I am not able to put my saved value (cblock 0x40) that I saved, into the PORTC register, as I move the 0x40 contents into the W reg. and then into PORTC. I actually simulated it in MPLABX and it simulated perfectly but in the actual application it gives me garbage and shifts the lcd, cursor, etc.. Now if I replace that line in (putting the 0x40 contents into W then into PORTC) my code with a hex or binary value placed into the w register and then into PORTC I get correct results.
I need to store the value that will go into PORTC in a variable location (because it changes depending on user input) and need to then place it into the PORTC.
I do not think that this is a read-modify-write common problem but I have never seen my situation before. Has anyone seen this before, and is there a way for me to do what I want possibly another way? I also tried using the FSR/ INDR indirect addressing but had the same negative results.
Thank you for your future help.
P