+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 3
    Points: 908, Level: 6

    Join Date
    Sep 2008
    Posts
    3
    Helped
    0 / 0
    Points
    908
    Level
    6

    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

    •   AltAdvertisement

        
       

  2. #2
    Member level 2
    Points: 1,545, Level: 8

    Join Date
    Aug 2008
    Posts
    44
    Helped
    7 / 7
    Points
    1,545
    Level
    8

    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.
    ;================================================= =


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Newbie level 3
    Points: 908, Level: 6

    Join Date
    Sep 2008
    Posts
    3
    Helped
    0 / 0
    Points
    908
    Level
    6

    pic16f877 keypad_init()

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



    •   AltAdvertisement

        
       

  4. #4
    Newbie level 3
    Points: 908, Level: 6

    Join Date
    Sep 2008
    Posts
    3
    Helped
    0 / 0
    Points
    908
    Level
    6

    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...



--[[ ]]--