Problem runing my code


Results 1 to 34 of 34

Threaded View

  1. #3
    Join Date
    May 2009
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    SORRY ITS JUST 7 SEGMENTS NOT LCD..this is the 7segment schema i did draw sorry i havnt draw it good but im sure thats enought to undersnd its normal 7seg working through 74hc164 shift register and 4 digit pins to the pic .atached them all to portb . it works fine with a counter like b0 = b0 +1 to 9999. but i cant add any pause or delay i need to findout how to run my program apart of the 7 segment routing or loop. <<<< ITS LIKE I HAVE A LED BLINK IN A LOOP AND I WANT TO WRITE MY CODE APART AND LET THE LED BLINKIN WITHOUT STOPING EVEN OTHER PROGRAME IS WORKIN AND HAS ITS DELAYS OR NO OR SOME ITS LIKE I WANT TO RUN 2 THINGS IN 1 TIME 2 LOOPS I DONNO IF TIMRERS WILL HELP OR WAT TO WITH THIS BLLODY THINGS LOL >>>>THIS 7SED GODE WORKS OK THE TOP 1 I POSTED BEFOR ISNT WORKING ANYWAY THANK U FOR HELP

    Code:
    @ DEVICE WDT_ON, PWRT_ON,MCLR_ON,CPD_OFF, BOD_OFF, PROTECT_OFF,INTRC_OSC_NOCLKOUT
          Include "modedefs.bas"
    DEFINE OSC 4
     
    
    intcon = 0		
    vrcon = 0
    CMCON = 7	     
    
    SDO  Var PortB.4
    SCLK Var PortB.5
    BTM  Var PortB.6
    BTN VAR PORTB.7
    SEG var byte 
    Digit var byte[4] 
    index var byte 
    B0 var word
    D0 var byte 
    
    PORTA = %00000
    PORTB = %11000000
    TRISA = %00000
    TRISB = %11000000
    
    B0 = 0
    
    loop:
    
    
    MAIN:
    ''''''''HERE IN THIS LOOP I CANT WRITE PROGRAME WHICH HAS DELAYS.
    '''''' ALL WAT I WANT IS TO LEAV THIS RUNING ITS ROUTING EACH PAUSEUSS999
    ''''''' I WANT TO PUT MY PROGRAME OUT OF THIS LOOP AND SEND WAT I WANT TO SEE ON THE 7SEGMENT TO  B0 VAR 
    if btN = 0 then b0 = b0 - 1
    if btm = 0 then  b0 = b0 +1
    D0 = B0 DIG 0                    
    READ D0,DIGIT[0]
    D0 = B0 DIG 1
    READ D0,DIGIT[1]
    D0 = B0 DIG 2
    READ D0,DIGIT[2]
    D0 = B0 DIG 3
    READ D0,DIGIT[3]
    
    for index = 0 to 3
    seg = digit [index]
    SHIFTOUT SDO,SCLK,0,[SEG\8]
    PORTB.0[index] = 1
    PAUSEUS 999
    PORTB=0
    NEXT INDEX
    
    GOTO MAIN
    
    END
    data @0,3,159,37,13,153,73,65,31,1,9
    Attached Images Attached Images  
    Last edited by Mus.me; - 22nd November 2009 at 22:37.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. 16F883 Code Verify Problem
    By munromh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2009, 11:47
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. problem with my code
    By civicgundam in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd February 2008, 01:52
  5. Code problem
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th May 2006, 04:43

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