problem in output voltages

Thread Starter

gracey

Joined Feb 19, 2011
14
hi,
we are making project "IC tester" using PIC16F877a. we had successfully load the program to the PIC... the problem is there's no output. the supplied voltage is 5V. when we checked the voltage across the IC, only 3V was measured. is the measured voltage across the IC which is 3V is the possible cause or reason why we obtain negative result?
(there's no output in the LED display)
Are we going to use transistor to amplify the voltage?
 

nerdegutta

Joined Dec 15, 2009
2,684
After a quick glance at the circuit, you need to but a resistor on the LEDs. But I don't think that is the problem.

What IC are you testing, the PIC 16F887A, or...
 

be80be

Joined Jul 5, 2008
2,072
gracey Are you sure that code complied? I tried it in MikroBasic and it has a bunch of mistakes your delays are wrong endif Is End IF


See if this don't work better
Rich (BB code):
program M_basicand

'main:
'   Main program
'test one
dim good as bit
dim indi as byte

trisa = 0
trisb = 0
trisc = %00001111
trisd.0 = 0
portd.0 = 0
portb = %00000000
indi = 0

PORTB.0 = 0
PORTB.1= 0
    If PORTC.0 = 0 Then
         Delay_ms(1000) 'so we don't miss ant thing'

       PORTB.0= 0
       PORTB.1 = 1
            If PORTC.0 = 0  Then
                Delay_ms(1000) 'so we don't miss ant thing

               PORTB.0= 1
               PORTB.1 = 0
                   If PORTC.0 = 0 Then
                    Delay_ms(1000) 'so we don't miss ant thing

                      PORTB.0 = 1
                      PORTB.1 = 1
                        If Portc.0 = 1 Then
                           good = 1
                           Delay_ms(1000)
                        else
                           good = 0
                        end if
                   else
                        good = 0
                   end if
            else
                good = 0
            end if
     else
        good = 0
     end if

     If good = 1 Then
       PORTc.4 = 1
       indi = indi + 1
     Else
          good = 0 ' was bad
          PORTc.4 = 0
     end if

'second gate

PORTB.2 = 0
PORTB.3= 0
    If PORTC.1 = 0 Then
         Delay_ms(1000) 'so we don't miss ant thing'

       PORTB.2= 0
       PORTB.3 = 1
            If PORTC.1 = 0  Then
                Delay_ms(1000) 'so we don't miss ant thing

               PORTB.2= 1
               PORTB.3 = 0
                   If PORTC.1 = 0 Then
                    Delay_ms(1000) 'so we don't miss ant thing

                      PORTB.2 = 1
                      PORTB.3 = 1
                        If Portc.1 = 1 Then
                           good = 1
                          Delay_ms(1000)
                        else
                           good = 0
                        end if
                   else
                        good = 0
                   end if
            else
                good = 0
            end if
     else
        good = 0
     end if

     If good = 1 Then
       PORTc.5 = 1
       indi = indi + 1
     Else
          good = 0 ' was bad
          PORTc.5 = 0
     end if


'third gate

PORTB.4 = 0
PORTB.5= 0
    If PORTC.2 = 0 Then
         Delay_ms(1000) 'so we don't miss ant thing'

       PORTB.4= 0
       PORTB.5 = 1
            If PORTC.2 = 0  Then
               Delay_ms(1000) 'so we don't miss ant thing

               PORTB.4= 1
               PORTB.5 = 0
                   If PORTC.2 = 0 Then
                    Delay_ms(1000) 'so we don't miss ant thing

                      PORTB.4 = 1
                      PORTB.5 = 1
                        If Portc.2 = 1 Then
                           good = 1
                           Delay_ms(1000)
                        else
                           good = 0
                        end if
                   else
                        good = 0
                   end if
            else
                good = 0
            end if
     else
        good = 0
     end if

     If good = 1 Then
       PORTc.6 = 1
       indi = indi + 1
     Else
          good = 0 ' was bad
          PORTc.6 = 0
     end if


'fourth gate

PORTB.6 = 0
PORTB.7= 0
    If PORTC.3 = 0 Then
        Delay_ms(1000)'so we don't miss ant thing'

       PORTB.6= 0
       PORTB.7 = 1
            If PORTC.3 = 0  Then
                Delay_ms(1000) 'so we don't miss ant thing

               PORTB.6 = 1
               PORTB.7 = 0
                   If PORTC.3 = 0 Then
                    Delay_ms(1000) 'so we don't miss ant thing

                      PORTB.6 = 1
                      PORTB.7 = 1
                        If Portc.3 = 1 Then
                           good = 1
                           Delay_ms(1000)
                        else
                           good = 0
                        end if
                   else
                        good = 0
                   end if
            else
                good = 0
            end if
     else
        good = 0
     end if

     If good = 1 Then
       PORTc.7 = 1
       indi = indi + 1
     Else
          good = 0 ' was bad
          PORTc.7 = 0
     end if

      If indi = 4 Then
        portd.0 = 1
     Else              ' not all gate is good
        portd.0 = 0
     end if

 end .
 
Last edited:
Top