Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Time for me to seduce you, there is no resisting me.

Options
  • 14-03-2006 5:52pm
    #1
    Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭


    $MOD52
    BYTEVAL EQU p2

    LCDBus EQU P2 ; define processor - LCD bus connections
    RS EQU P3.5 ; define LCD control signal connections
    RW EQU P3.6
    EN EQU P3.7


    KPADPORT EQU P0 ; col/row port & pin assignment
    COL0 EQU P0.0
    COL1 EQU P0.1
    COL2 EQU P0.2
    COL3 EQU P0.3
    ROW0 EQU P0.4
    ROW1 EQU P0.5
    ROW2 EQU P0.6
    ROW3 EQU P0.7


    ORG 000H
    LJMP MAIN

    ORG 300H
    MAIN:
    LCALL INIT_LCD
    LCALL CLR_LCD
    MOV SP, #2FH
    SETB C
    CLR_LED

    MAINPROGLOOP:
    SETB C
    NOP
    LCALL keypadPoll
    NOP
    SJMP MAINPROGLOOP

    ORG 1200H
    CLR_LCD: DB 01h,0FFh ; clear LCD display, place cursor on left of display
    INiT_LCD: DB 38h,0Eh,06h,0FFh ; set bus width (8 bits), display type (2 line, 5x7 d

    keypadPoll:
    mov r0,#4
    mov a, #0F7h
    push acc


    TRYNXTCOL:
    mov kpadport, a
    setb c
    rrc a
    push acc


    CHKROW3: mov a, R0
    ADD A, #12H
    call waitKeyRelease

    sjmp LOOKUPKEYTABLE

    CHKROW2: mov a, R0
    ADD A, #8H
    call waitKeyRelease

    sjmp LOOKUPKEYTABLE

    CHKROW1: mov a, R0
    ADD A, #4H
    call waitKeyRelease

    sjmp LOOKUPKEYTABLE

    CHKROW0: mov a, R0



    sjmp LOOKUPKEYTABLE

    searchNxtCol:

    sjmp keypadPoll

    LOOKUPKEYTABLE:
    mov dptr, #convertTable
    movc a,@a+dptr



    lcall WRITE_DATA_TO_LCD

    WRITE_DATA_TO_LCD:

    CLR A
    MOVC A, @A+DPTR

    ContinueLCD:
    MOV LCDBus, A
    LCALL txfr2LCDAndChkLCDBusyFlg
    INC DPTR;
    MOV A,#00h
    MOVC A,@A+DPTR
    CJNE A, #0FFh, ContinueLCD
    ret

    txfr2LCDAndChkLCDBusyFlg:
    call clrEN
    call setEN
    call setRW ; LCD read mode since reading LCD port for BUSY flag
    MOV LCDBus, #0FFh ; set all LCD port pins as inputs

    chkLCDBusy: ; then wait until LCD busy flag is deasserted :
    MOV A, LCDBus ; read LCDBus data from LCD
    JB Acc.7, chkLCDBusy ; test busy flag bit and wait until clear (if set, loop since LCD is busy)
    NOP
    NOP
    NOP

    call clrRW ;

    RET



    waitKeyRelease: ; polls port row inputs until all keys are released (all row bits='0')
    mov kpadport, #0F0h ; assert all column o/p bits ('0') and define row bits as inputs
    mov a, kpadport ; read keypad port for row data

    jnb ROW0,waitKeyRelease ; keep checking until row bit 0 = '1'. Otherwise continue
    jnb ROW1,waitKeyRelease ; keep checking until row bit 0 = '1'. Otherwise continue
    jnb ROW2,waitKeyRelease ; keep checking until row bit 0 = '1'. Otherwise continue
    jnb ROW3,waitKeyRelease ; keep checking until row bit 0 = '1'. Otherwise continue

    lcall CLR_LCD
    ret


    convertTable:db'0123F456E789DA0BC'

    ret

    end


«13

Comments

  • Registered Users Posts: 6,121 ✭✭✭homah_7ft


    Reply.


  • Registered Users Posts: 6,800 ✭✭✭county


    god,no one is safe:eek: :eek: :eek:


  • Registered Users Posts: 6,121 ✭✭✭homah_7ft


    Triplets


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    My seed is strong.



    txfr2LCDAndChkLCDBusyFlg:
    call clrEN
    call setEN
    call setRW ; LCD read mode since reading LCD port for BUSY flag
    MOV LCDBus, #0FFh ; set all LCD port pins as inputs

    ^^^see.


  • Closed Accounts Posts: 31,967 ✭✭✭✭Sarky


    /me resists Tar's seductive techniques

    Ha! Tekkit!


  • Advertisement
  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    error error error

    *explode*


  • Posts: 0 ✭✭✭ [Deleted User]


    what that supposed 2 b???


  • Registered Users Posts: 22,231 ✭✭✭✭Sparky




  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 90,814 Mod ✭✭✭✭Capt'n Midnight


    Oui, s'il est base a base de controlleur Hitachi HD47780!
    Sinon c'est impilotable.

    Les LCD du marches c'est le cas, mais si tu as recuperer un LCD c'est peut etre un truc proprietaire...


  • Moderators, Education Moderators Posts: 8,561 Mod ✭✭✭✭Rhyme


    Divide by 0...


  • Advertisement
  • Closed Accounts Posts: 122 ✭✭tubey


    error error error

    *explode*

    You post some shite do you know that. Get a life for yourself.


  • Closed Accounts Posts: 31,967 ✭✭✭✭Sarky


    Clearly you are gay. Or possibly even teh ghey.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    tubey wrote:
    You post some shite do you know that. Get a life for yourself.
    Which of my scorned cheribs are you?
    <3!


  • Registered Users Posts: 3,958 ✭✭✭Chad ghostal


    PFFft assembleY!
    back in my day* we etched binary onto bricks and threw them at the monitor





    *zombie thread portal*
    **almost made up


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    I will win you over with the power of the ARM.
    /extends ARM.


  • Closed Accounts Posts: 9,878 ✭✭✭Rozabeez


    /me swoons...


    OHH....beautiful, beautiful ARM.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    My thank yous. I work hard, I play hard.


  • Closed Accounts Posts: 688 ✭✭✭skye


    Play harder damn it!!


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    *PLAYS HARDER*


    sjmp LOOKUPKEYTABLE

    CHKROW0: mov a, R0


  • Closed Accounts Posts: 1,838 ✭✭✭Doomspell


    wtf!


  • Advertisement
  • Closed Accounts Posts: 31,967 ✭✭✭✭Sarky


    10 For I=1 to 10
    20 Print"Tar, I love you" I "much!!!!<3"
    30 Next I


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    (i=0;i<infinity;i++)
    {

    printf("will you marry me? I want your babies."\n);

    }

    I call this the heart algorithm. :o


  • Closed Accounts Posts: 31,967 ✭✭✭✭Sarky


    While Pant$="On"
    Print "NEVAR!"
    Wend


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    *removes sarkys pants*


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 90,814 Mod ✭✭✭✭Capt'n Midnight


    On error goto Panting
    Pants=Pants-1

    Superman=Pants/Trousers


  • Closed Accounts Posts: 31,967 ✭✭✭✭Sarky


    *removes sarkys pants*


    INPUT/OUTPUT OVERFLOW ERROR


  • Registered Users Posts: 30,123 ✭✭✭✭Star Lord


    if pant$="OFF" {
    while overflow$=\="FALSE"
    printf ("Insert disc"\n);
    printf ("Remove disc"\n);
    wend;
    };
    printf ("Thanks love! Do you have a light?"\n);
    endif;


  • Registered Users Posts: 9,706 ✭✭✭Matt Holck


    multiple key register spy ware slows my proformance
    you boys need to get together and share


  • Closed Accounts Posts: 1,838 ✭✭✭Doomspell


    Okay tar...give me your best shot!


  • Advertisement
  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    Well, you would have toi get the bus or train to galway or the beers tomorrow to see my best shot. But here is something toi look forward to:

    sjmp LOOKUPKEYTABLE

    searchNxtCol:

    sjmp keypadPoll

    LOOKUPKEYTABLE:
    mov dptr, #convertTable
    movc a,@a+dptr



    lcall WRITE_DATA_TO_LCD

    WRITE_DATA_TO_LCD:

    LCD_OUTPUT: I LOVE YOU DOOMSPELL. BE MY GIRL <3


Advertisement