Input problems with PortD on Pic16F874A


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    another thing...
    Code:
    @ DEVICE HS_OSC
    is invalid. look at the faq there's a whole thread about config fuses setting.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Aug 2006
    Location
    Kalmar in sweden
    Posts
    5


    Did you find this post helpful? Yes | No

    Smile

    Hi again, and thanks a million for all the help.
    Nothing worked!
    So I gave up and tried from scratch with a new .bas file, and then…
    EUREKA!

    Here is my test code that worked:

    '-------------------------------------------------
    'från början

    @ DEVICE HS_OSC
    DEFINE OSC 20
    ADCON1 = 7
    LED VAR PORTB.5
    UT1 var PORTB.4
    UT2 var PORTB.2
    UT3 var PORTB.1
    UT4 var PORTB.0
    UT5 var PORTD.7
    UT6 var PORTD.6
    UT7 var PORTD.5
    UT8 var PORTD.4
    UT9 var PORTC.7
    UT10 var PORTC.6
    IN1 var PORTC.2
    IN2 var PORTC.3
    IN3 var PORTD.1
    IN4 var PORTD.0
    IN5 var PORTC.5
    IN6 var PORTC.4
    IN7 var PORTD.3
    IN8 var PORTD.2

    BOOT:
    PAUSE 500
    LOW led

    LOOP:
    IF IN1 = 1 THEN high UT1
    IF IN2 = 1 THEN high UT2
    IF IN3 = 1 THEN high UT3
    IF IN4 = 1 THEN high UT4
    IF IN5 = 1 THEN high UT5
    IF IN6 = 1 THEN high UT6
    IF IN7 = 1 THEN high UT7
    IF IN8 = 1 THEN high UT8
    pause 1
    LOW UT1:LOW UT2:LOW UT3:LOW UT4:LOW UT5:LOW UT6:LOW UT7:LOW UT8:LOW UT9:LOW UT10
    goto loop
    '-------------------------------------------------

    Sometimes the world is a bit strange, but for the moment I am happy :-)

    Thanks again for all your help.


    / Petter

Similar Threads

  1. Input problems with 12F629?
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 24th April 2018, 06:25
  2. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50
  3. Input problems
    By ALFRED in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd July 2006, 21:02
  4. Problems with PORTD on 18F658
    By blainecf in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th June 2006, 17:32
  5. 18F6680 and portd problems.
    By jkbh in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 6th June 2005, 10:54

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