![]() | ![]() | ![]() |
| |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
![]() |
| | Tools |
| | #1 | |
|
I successfully programmed DMC 16249 LCD in 8-bit parallel mode using PIC16F84A. Now my instructor wants me to program that same LCD in serial mode using 74LS164 shift register. I moded my code but all I get is a line and a half of blocks at the output. I already changed LCD, Shift Register, PIC16F84A and even tried it with PIC16F877 with no luck. My code has been reviewed by 3 people already with no one finding anything wrong with it. I don't know what I am doing wrong please help. My code below for reference: Note: I use MPLAB v8.30, the code compiles with no errors. Also, I use Pickit 3 to program the PIC16F84A and PIC16F877. Quote:
__________________ "The people who cast the votes don't decide an election, the people who count the votes do." -Joseph Stalin Last edited by Frosty_47; 13th August 2009 at 11:14 PM. | ||
| |
| | #2 |
|
I was wondering if dead/faulty XTAL oscilator can cause this problem... I mean what are the chance of XTAL failing ?
__________________ "The people who cast the votes don't decide an election, the people who count the votes do." -Joseph Stalin | |
| |
| | #3 | |
| Quote:
Ran in your program in the OS sim,OK, using a modified external S/R module. Note this ext module clocks on the low to high edge. Look at these two images. The S/R shows the 0x38 LCD setup code byte, have you wired the LCD so that D7 of the S/R is the LSB [D0] of the LCD.??? Also the clocking pulse in the program is going high to low,, the LS164 datasheet states a low to high clock pulse edge.??? Also are you resetting the LS164 at power up.?? Please post your circuit diagram. EDIT: The LCD setup sequence needs reworking. Send at least 2 or 3, 0x38's remove all but one of the 0x06's and check the remainder. Checked thru all the LCD init and data transfer, it checks OK in simulation.
__________________ Eric " Good enough is Perfect " I will NOT answer PM's requesting technical help, please use the Forum PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/ Last edited by ericgibbs; 13th August 2009 at 01:41 PM. | ||
| |
| | #4 |
|
Use the PK3 debug mode on the 16F877. If the crystal isn't running it won't enter debug. PS if you're using a solderless breadboard crystals may not work properly. Also don't forget 0.1uF decoupling caps on VDD &VSS they're not optional. | |
| |
| | #5 |
|
Thank you for taking time to help me. I moded the code. However still get nothing at output. Oh and I don't see why the D7 of S/R be connected to LSB when I am shifting right... I tried that anyway with no luck ![]() My moded code below for reference: PHP Code:
__________________ "The people who cast the votes don't decide an election, the people who count the votes do." -Joseph Stalin Last edited by Frosty_47; 13th August 2009 at 11:15 PM. | |
| |
| | #6 |
|
Learn to use the debugger. Makes troubleshooting much easier.
| |
| |
| | #7 |
|
hi Frosty, Unzip this zip into an avi and play on your Windows Media. I have modified an Oshonsoft module to work as a 74LS164.
__________________ Eric " Good enough is Perfect " I will NOT answer PM's requesting technical help, please use the Forum PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/ | |
| |
| | #8 | |
| Quote:
![]() Yeah, I changed the code to rotate LEFT, that way no need to reconnect the LCD. Still no luck... I get a blank display...
__________________ "The people who cast the votes don't decide an election, the people who count the votes do." -Joseph Stalin | ||
| |
| | #9 |
|
I GOT IT TO WORK! I found one eror in DATAWRT section: Eror found: BCF PORTA,0 ;RS = 1 for command Correct Code: BSF PORTA,0 ;RS = 1 for command Also I had to add: PHP Code: Here is the Working Code: PHP Code: I found your video to be very helpful in reminding me of shift register operation...
__________________ "The people who cast the votes don't decide an election, the people who count the votes do." -Joseph Stalin Last edited by Frosty_47; 13th August 2009 at 11:29 PM. | |
| |
| | #10 |
|
hi, Just a small point about your listing. Code: MOVLW "A"; 0x41 ;Display letter 'A' CALL DATAWRT CALL DELAY MOVLW "N"; 0x4E ;Display letter 'N' CALL DATAWRT CALL DELAY MOVLW "D"; 0x44 ;Display letter 'D' CALL DATAWRT CALL DELAY MOVLW "R" ;0x52 ;Display letter 'R' CALL DATAWRT CALL DELAY MOVLW "E";0x45 ;Display letter 'E' CALL DATAWRT CALL DELAY
__________________ Eric " Good enough is Perfect " I will NOT answer PM's requesting technical help, please use the Forum PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/ | |
| |
|
| Tags |
| lcd, pic16f84a, programming |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Pic16f84a | mycalbs | Micro Controllers | 1 | 24th February 2009 03:01 PM |
| PIC16F84A need help | kac121 | Micro Controllers | 15 | 21st June 2006 11:31 PM |
| Problem Programming PIC16F84A | shoie01 | Micro Controllers | 1 | 9th March 2005 09:12 AM |
| Program verify error when programming pic16f84a chip | xpembedded | Micro Controllers | 2 | 31st May 2004 10:07 AM |
| problem of programming pic16f84a | Byron Yau | Micro Controllers | 15 | 19th April 2003 06:10 PM |