Programming TMR0 Interrupt in PICBasic


Results 1 to 8 of 8

Threaded View

  1. #5
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Display Example, to drive LED displays

    For the display part, I would like to make a suggestion.

    Since you will need to drive say PORTB with a HEX number to display a digit on the LED display, I would recommend storing HEX values in EEPROM.


    Code:
    EEPROM 0,[$c0,$F9,$A4,$B0,$99,$92,$82,$F8,$80,$90]
    
    
    Incoming = 5 
    'from 0 to 9
    
    
    READ Incoming, PORTB

    So that you won't need to use a lookup table.


    '==Display Configuration==

    A PORTB.0
    B PORTB.1
    C PORTB.2
    D PORTB.3
    E PORTB.4
    F PORTB.5
    G PORTB.6
    Dt PORTB.7

    'NUMBER - HEX on Portb
    'high pin turns off the led.
    'low pin turns on the led.

    0= $c0
    1= $F9
    2= $A4
    3= $B0
    4= $99
    5= $92
    6= $82
    7= $F8
    8= $80
    9= $90
    -= $BF
    C= $C6




    - This configuration was for 4x7 Segment LED display.


    ________________________--
    Last edited by sayzer; - 6th September 2006 at 19:22.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. TMR0 interrupt and HSERIN
    By boban in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2008, 11:48
  4. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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