Question
1. Make a diagram showing all necessary wiring to use the keypad(AK-1607) with the PIC16F1829 based on the program Lab08AKeypad-1829.c (shown below). Using PIC16f1829 and
1. Make a diagram showing all necessary wiring to use the keypad(AK-1607) with the PIC16F1829 based on the program Lab08AKeypad-1829.c (shown below). Using PIC16f1829 and LPC board to use a keypad (AK-1607)
Lab08AKeypad-1829.c :
Using PIC16f1829 and LPC board to use a keypad Compiler: XC8 v1.34 IDE: MPLABX v3.00 */ #include
// Configuration #pragma config FOSC=INTOSC, WDTE=OFF, PWRTE=OFF, MCLRE=OFF, CP=OFF, CPD=OFF, BOREN=ON, CLKOUTEN=ON, IESO=OFF, FCMEN=OFF #pragma config WRT=OFF, PLLEN=OFF, STVREN=OFF, LVP=OFF // CONFIG7H
//-------------------PROGRAM MEMORY-------- #define _XTAL_FREQ 4000000
void init (void) { OSCCON=0b01010010; ANSELA = 0; ANSELB = 0 ; ANSELC=0; TRISA=0; TRISB=0xF0; TRISC=0; nWPUEN=0; WPUA=0; WPUB=0xF0; WPUC=0; LATC=14; NOP(); }
main() { init(); while (1) { __delay_ms(100); LATA2=0; LATA1=0; LATA0=0; while (PORTB==0xF0) {NOP();} __delay_ms(5);
while (!(PORTB == 0xF0)) { LATA2=1; LATA1=1; LATA0=0; if (PORTB==0b11100000) LATC=1; else if (PORTB==0b11010000) LATC=4; else if (PORTB==0b10110000) LATC=7; else if (PORTB==0b01110000) LATC=0x2A;
LATA2=1; LATA1=0; LATA0=1; // if (PORTB==0b11100000) LATC=2; else if (PORTB==0b11010000) LATC=5; else if (PORTB==0b10110000) LATC=8; else if (PORTB==0b01110000) LATC=0x0B;
LATA2=0; LATA1=1; LATA0=1; if (PORTB==0b11100000) LATC=3; else if (PORTB==0b11010000) LATC=6; else if (PORTB==0b10110000) LATC=9; else if (PORTB==0b01110000) LATC=0x0C; __delay_ms(5); } } } //
(AK-1607)
ABC DEF 2 GHI | JKL| MNO 4 PRS TUV WXY 789 C 0 ABC DEF 2 GHI | JKL| MNO 4 PRS TUV WXY 789 C 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started