Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HELP! PIC16LF877A with keypad

Status
Not open for further replies.

ezad

Newbie level 3
Joined
Sep 6, 2008
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
pic16lf877a

i really a newbie on PICs..
need help from u pro out there how to program my PIC when i connect those kit like the document i attached..
the keypad is for 4 digit code and the the PIC will send signal to the bluetooth module..

KEYPAD >> PIC >> BLUETOOTH ------> BLUETOOTH >> PIC >> MOTOR CONTROL BOARD
 

mikrobasic keypad

Hi I'm also newbie in PIC but I already try keypad and LCD once but for bluetooth not yet. I use MikroBasic V7.2 from MikroElektronika. i Attached the sample program. Just Checked. ( I Use PIC 16f877A).

LCD Connection :
Port b :
R/W = Gnd
E = pb.3
rs = pb.2
data = pb.4 - pb.7
Keypad Connection :
Row 1-4 = PC.0 - PC.3
Col 1-4 = PC.4 - PC.7

;=================================================
program new_lcd_keypad_done
dim kp, curX, curY as byte

main:
curX=1
curY=1 ' For keeping record of the 2x16 LCD cursor position

Keypad_Init(PORTD) ' Initialize Keypad on PORTC

Lcd_Init(PORTB) '
Lcd_Cmd(LCD_CLEAR) ' Clear display

while true

kp = 0

' Wait for key to be pressed and released
while kp = 0
kp = Keypad_Released()
Delay_ms(10)
wend

' Prepare value for output
select case kp
case 1 kp = "1"
case 2 kp = "2"
case 3 kp = "3"
case 4 kp = "A"
case 5 kp = "4"
case 6 kp = "5"
case 7 kp = "6"
case 8 kp = "B"
case 9 kp = "7"
case 10 kp = "8"
case 11 kp = "9"
case 12 kp = "C"
case 13 kp = "*"
case 14 kp = "0"
case 15 kp = "#"
case 16 kp = "D"
end select

if (curY > 16) then ' change cursor position
if (curX = 1) then
Lcd_Cmd(LCD_SECOND_ROW)
curX = 2
curY = 1
else
Lcd_Cmd(LCD_FIRST_ROW)
curX = 1
curY = 1
end if
end if

' Print on LCD
Lcd_Chr_CP(kp)
Inc(curY)

wend
end.
;==================================================
 

    ezad

    Points: 2
    Helpful Answer Positive Rating
pic16f877 keypad_init()

hey thanks..
i'll try dis one ASAP and tell u the result..
;)
 

control del motor con el 16lf877a

could you post your diagram..
pls..
and which oscillator do you use?
:)

really need to know what the diff btwn 16F877A and 16LF877A...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top