PIC 18F452 Table Pointer/ Table Read


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    sougata, Here is a snipit of code I used with some HP-HCMS-29XX displays for a battery charger I designed. I retrieved them from old Motorola cell phones. It decodes the ascii value of the character and places the 5 collums of data into the appropriate arrays. The values in the table are the leds from bottom=msb to top=lsb. HTH

    ' ************************************************** ******************
    CHARTABL: 'CHARACTER LOOK-UP TABLE FOR COLLUMS
    ' ************************************************** ******************
    IF CHARACTER > 31 THEN
    ' " ","!",""","#","$","%","&","'","(",")","*","+", ",",
    '"-",".","/","0","1","2","3","4","5","6","7","8","9",":",";", "<","=",">","?",
    '"@","A","B","C","D","E","F","G","H","I","J","K"," L","M","N","O","P","Q","R",
    '"S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e",
    '"f","g","h","i","j","k","l","m","n","o","p","q"," r","s","t","u","v","w","x",
    '"y","z","{","|","}","~"]
    COL1:
    LOOKUP CHARACTER - 32,[$00,$00,$00,$14,$24,$23,$36,$00,$1C,$00,$14,$08,$0 0,_
    $08,$00,$20,$3E,$00,$42,$21,$18,$27,$3C,$01,$36,$0 6,$00,$00,$08,$14,$00,$02,_
    $32,$7E,$7F,$3E,$7F,$7F,$7F,$3E,$7F,$00,$20,$7F,$7 F,$7F,$7F,$3E,$7F,$3E,$7F,_
    $46,$01,$3F,$1F,$3F,$63,$07,$61,$7F,$02,$00,$04,$4 0,$00,$20,$7f,$38,$38,$38,_
    $08,$0c,$7f,$00,$00,$7f,$00,$7c,$7c,$38,$7c,$08,$7 c,$48,$04,$3c,$1c,$3c,$44,_
    $0c,$44,$08,$00,$00,$00],COLLUM(0)
    COL2:
    LOOKUP CHARACTER - 32,[$00,$00,$07,$7F,$2A,$13,$49,$05,$22,$00,$08,$08,$5 0,_
    $08,$60,$10,$51,$42,$61,$41,$14,$45,$4A,$71,$49,$4 9,$36,$56,$14,$14,$41,$01,_
    $49,$11,$49,$41,$41,$49,$09,$41,$08,$41,$40,$08,$4 0,$02,$04,$41,$09,$41,$09,_
    $49,$01,$40,$20,$40,$14,$08,$51,$41,$04,$00,$02,$4 0,$01,$54,$48,$44,$44,$54,_
    $7E,$52,$08,$44,$20,$10,$41,$04,$08,$44,$14,$14,$0 8,$54,$3F,$40,$20,$40,$28,_
    $50,$64,$36,$00,$00,$08],COLLUM(1)
    COL3:
    LOOKUP CHARACTER - 32,[$00,$4F,$00,$14,$7F,$08,$55,$03,$41,$41,$3E,$3E,$3 0,_
    $08,$60,$08,$49,$7F,$51,$45,$12,$45,$49,$09,$49,$4 9,$36,$36,$22,$14,$22,$51,_
    $79,$11,$49,$41,$41,$49,$09,$49,$08,$7F,$41,$14,$4 0,$0C,$08,$41,$09,$51,$19,_
    $49,$7F,$40,$40,$38,$08,$70,$49,$41,$08,$41,$01,$4 0,$02,$54,$44,$44,$44,$54,_
    $09,$52,$04,$7D,$40,$28,$7F,$18,$04,$44,$14,$14,$0 4,$54,$44,$40,$40,$30,$10,_
    $50,$54,$41,$7F,$41,$04],COLLUM(2)
    COL4:
    LOOKUP CHARACTER - 32,[$00,$00,$07,$7F,$2A,$64,$22,$00,$00,$22,$08,$08,$0 0,_
    $08,$00,$04,$45,$40,$49,$4B,$7F,$45,$49,$05,$49,$4 9,$00,$00,$41,$14,$14,$09,_
    $41,$11,$49,$41,$22,$49,$09,$49,$08,$41,$3F,$22,$4 0,$02,$10,$41,$09,$21,$29,_
    $49,$01,$40,$20,$40,$14,$08,$45,$00,$10,$41,$02,$4 0,$04,$54,$44,$44,$48,$54,_
    $01,$52,$04,$40,$44,$44,$40,$04,$04,$44,$14,$18,$0 4,$54,$40,$20,$20,$40,$28,_
    $50,$4C,$00,$00,$36,$08],COLLUM(3)
    COL5:
    LOOKUP CHARACTER - 32,[$00,$00,$00,$14,$12,$62,$50,$00,$00,$1C,$14,$08,$0 0,_
    $08,$00,$02,$3E,$00,$46,$31,$10,$39,$30,$03,$36,$3 E,$00,$00,$00,$14,$08,$06,_
    $3E,$7E,$36,$22,$1C,$41,$01,$7A,$7F,$00,$01,$41,$4 0,$7F,$7F,$3E,$06,$5E,$46,_
    $31,$01,$3F,$1F,$3F,$63,$07,$43,$00,$20,$7F,$04,$4 0,$00,$78,$38,$20,$7F,$18,_
    $02,$3E,$78,$00,$3D,$00,$00,$78,$78,$38,$08,$7C,$0 8,$20,$20,$7C,$1C,$3C,$44,_
    $3C,$44,$00,$00,$08,$04],COLLUM(4)
    ENDIF
    RETURN

    Dave Purola,
    N8NTA

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Thanks Dave

    Hi,

    Thanks dave for the Lookup table. Any thoughts on the table read issue ?
    Regards

    Sougata

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    do a search within a thread called 'embedded string in your codespace' or something like that. If my memory is good, there's some example in there.

    MPASM book explain it a little bit too. Maybe there's some appnote on the Microchip's website.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Thanks steve

    Hi,

    Darrel used the READCODE in his example of embedding strings. The article is located here http://www.pbpgroup.com/modules/wfse...p?articleid=10 .

    Bruce used the table pointer in his example for the PIC18F452 http://www.picbasic.co.uk/forum/showthread.php?t=1999 located here. By the way Steve your memory is great only you need to brushup your pointer skills
    Regards

    Sougata

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    LMAO! but... did you read the name of the thread where you take the Bruce example..

    Hum hum!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Red face I suffered a stack overflow,searced for the data without the index

    Hey Steve,

    Sorry pal to comment on your pointer skills, I am pushing myself harder and harder to get a few pending jobs done within this MARCH. Need a RESET followed by a Sleep with the watchdog and interrupt (wife) disabled.
    Regards

    Sougata

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yeah i know what you mean... don't worry.

    I've myself some USART problem between my head and the rest of the body.. arms and legs

    Beer didn't help... just worst. I really need a human ICD NOW!!!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. How i ken read 7.2v with pic
    By jetpr in forum Schematics
    Replies: 10
    Last Post: - 18th June 2006, 09:44
  2. Help, problems first time with 18F452 PIC
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2005, 20:49
  3. PIC read program
    By TEOWK in forum General
    Replies: 3
    Last Post: - 10th June 2005, 13:48
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. PIC vs PLC (programmable logic controller)
    By pondindustrial in forum Off Topic
    Replies: 4
    Last Post: - 17th December 2004, 21:11

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts