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

    So I have the theory correct the strange thing is when i set B.4 and B.5 to high and B.6 to low, it displays on the 3rd segment with correct brightness. But when I try set B.4 or B.5 low and the others high, those 2 segments (1st and 2nd) appear dim. Can only think it's my code I will keep reading and trying. Thanks for the response

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Yes, the theory is correct but 500ms per digit seems a bit slow, it'll definitely be flickering... ;-)

    I don't mean to step on any toes or anything but you DO have resistors in series with LED segments don't you? Don't connect them directly to the PIC. If you don't have any resistors you may have toasted some of the segments due to too much current.... And don't forget the driver/buffer for the common cathodes, don't try to sink all that current thru the PICs I/O's.

    /Henrik.

  3. #3
    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

  4. #4
    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