what is wrong in this code


Results 1 to 14 of 14

Threaded View

  1. #1
    Join Date
    Jan 2012
    Posts
    24

    Default what is wrong in this code

    i want to light the led at portb.0 when the output of comparator is high and to light led at portb.1 when comparator output is low, my code compiled successful and on running this code light a ked at portb.1 always without depending on the output of the copmarator, the output of the comparator doesn't depend on the inputs...what is wrong hear

    this is my code and i attach my circuit

    Code:
    C10UT VAR CMCON.6
    ADCON1=7
    CMCON=2
    PORTB=%00000000
    TRISB=%00000000
    
    lop:
        if c10ut=1 then
        portb.0=1
        
        else
          portb.1=1
          
         endif 
          
          goto lop
          end
    Attached Images Attached Images

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