16F627A portA4 problem?


Closed Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Posts
    53

    Question 16F627A portA4 problem?

    I have recently changed from red LEDs to blue LEDs and encountered
    a strange problem on port A4 on a 16F627A. Port A4 is an open drain output
    connected to the LED cathode, the LED anode is connected to 5 vdc via a 1 K resistor. The red LED works as expected but the Blue LED will not turn off
    unless I use a 10 K pullup around the blue LED. The blue LED has a larger
    forward drop than the red and should have a lower current than the red LED.

    Does anybody have any ideas? Am I missing something?

    I defined my I/O and disabled the comparators

    TRISA = %00001100
    TRISB = %00000010
    CMCON=%00000111 ' Comparators OFF


    IF k = 1 Then
    F = $F8
    low portb.0 'turn on LED 1
    low porta.4 'turn on LED 2
    low porta.6 'turn on LED 3
    Return
    EndIF
    IF k = 2 Then
    F = $FE
    low portb.0 'turn on LED 1
    high porta.4 'turn off LED 2
    high porta.6 'turn off LED 3
    Return

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Mark,

    This sounds like it might be a "read-modify-write" problem.

    Maybe you could try using INPUT instead of HIGH to turn off PORTA.4.

    <pre><b>INPUT porta.4 'turn off LED 2</b></pre>
    DT

Similar Threads

  1. 16F627A to 16F88 conversion problem
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th February 2009, 20:20
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 09:12
  3. Microcode Studio 18f2455 problem?????
    By volkan in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st May 2007, 22:04
  4. PicBasic Pro Math Problem??
    By Glen65 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th March 2006, 05:36
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 23:59

Members who have read this thread : 1

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