16F690 and i2c Com


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Yea I had it at 500ms just to see if I could get each digit to display in sequence (which doesn't work). I have resistors in series with each segment but I will be honest I dont know what you mean by driver/buffer? I thought if it was a common ANODE you could use a transistor but as I said earlier my electronics is touch and go and I'm not sure how I would go about hooking that up

  2. #2
    Join Date
    May 2010
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Solved

    I neatened up my code and it solved the problem why exactly it solved the problem I am not sure, but im glad it did

    Code:
    TRISC = %00000000       
    TRISB = %00000000
    
    ADCON1=%00000111
    ANSELH=0
    ANSEL=0
    CM1CON0=0
    CM2CON0=0
    
    
           
    loop:   
           GOSUB selseg1
           gosub disno1
           pause 5
           GOSUB selseg2
           gosub disno2
           pause 5
           GOSUB selseg3
           gosub disno3
           pause 5
    goto loop  
    
    Selseg1:
         portb = %01111111
         RETURN
    
    Selseg2:
         portb = %11011111
         Return
         
    Selseg3:
         portb = %10111111
         RETURN
    
    DisNo1:
      PORTC = %01000010
      Return
         
    DisNo2:
         PORTC = %01101101     
         return
         
    DisNo3:
         PORTC= %00111101
          return
          
     DisNo4:
         PORTC = %00011110     
         return
         
    DisNo5:
         PORTC = %00111011 
         return
         
     DisNo6:
         PORTC = %01111010     
         return
         
      DisNo7: 
        PORTC = %00010101      
         return
         
     DisNo8:
         PORTC = %01111111    
         return
         
     DisNo9: 
         PORTC = %00111111             
         return        
    End

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