PIC16F877A based project

Thread Starter

harami

Joined Jun 20, 2011
66
im using crystal and i have config _HS_OSC on the code as well... i tried to test my circuit again... this time it worked. when i press keys on the keypad it turns the LEDs ON which proves that the circuit digram is working now. however only some of the keys on the keypad gives an output when they have been pressed. so i checked my code again. i dont see any problems with it. however if anyone could give some of there time to check the code i will be thankful to them. i have already attached the code previously. only changes i have made to the code is i change the OSC from RC to HS, rest is same.
 

stahta01

Joined Jun 9, 2011
133
Rich (BB code):
keyscan
    clrf    KEYPORT

        ;SCAN COLUMN 1
    BSF        KEYPORT, _C1
        ;KEY 1
    BTFSC    KEYPORT, _R1
    RETLW    .1
        ;KEY 4
    BTFSC    KEYPORT, _R2
    RETLW    .4
        ;KEY 7
    BTFSC    KEYPORT, _R2
    RETLW    .7
        ;KEY *
    BTFSC    KEYPORT, _R2
    RETLW    .10
Why does the code you attached need many edits to get it to assemble?
(It was a lot of formatting issues; like you cut and pasted it in a way that deleted leading spaces)

Why do you test R1 once and R2 three times and never test R3 and R4?

Tim S.
 
Last edited:

MCrowe

Joined May 29, 2011
69
Hey, not sure how happy people are about pasting eBay links here but here goes.
Get one of these. Lol. Seriously. I only started out with pic programming 3 months ago, had everything built on a bread board, and nothing worked. This board is the most awesome thing I ever got for starting out learning Pic stuff. It basically just a breakout board, but it alread has the crystal built in, all the Vcc and Vss leads connected correctly, a serial port with MAX232 chip built in, a voltage regulator, a bank of LED's connected to port D, 4 switches, and heads for all the pins and also a bank of headers for Vcc and Vss that you can use for other stuff. Oh and you don't wreck your chip taking it out for programming, (if you use an external programmer like I do)

http://www.ebay.com.au/itm/New-PIC-...796?pt=LH_DefaultDomain_0&hash=item3f09af1cec

Dont worry I have no affiliation with anyone selling these, but for under $20 free shipping, and they come with the Pic chip 16f877a.... If your just learning as I was I would strongly suggest getting one.
 
Top