Need some pointers on 16F628 inputs


Results 1 to 7 of 7

Threaded View

  1. #6
    Join Date
    Dec 2005
    Posts
    8


    Did you find this post helpful? Yes | No

    Default This is getting frustrating...

    Here is the latest code bit:

    define osc 4

    CMCON = 7

    TRISA = %11111111
    TRISB = %00000000

    PB0 VAR PORTB.0
    PB1 VAR PORTB.1
    PB2 VAR PORTB.2
    PB3 VAR PORTB.3

    SW0 VAR PORTA.0
    SW1 VAR PORTA.1
    SW2 VAR PORTA.2
    SW3 VAR PORTA.3

    SCAN:
    If SW0 = 1 then
    HIGH PB0:PAUSE 2000
    ELSE
    LOW PB0
    ENDIF

    If SW1 = 1 then
    HIGH PB1:PAUSE 2000
    ELSE
    LOW PB1
    ENDIF

    If SW2 = 1 then
    HIGH PB2:PAUSE 2000
    ELSE
    LOW PB2
    ENDIF

    If SW3 = 1 then
    HIGH PB3:PAUSE 2000
    ELSE
    LOW PB3
    ENDIF

    HIGH PORTB.5
    PAUSE 20
    LOW PORTB.5
    PAUSE 20

    GOTO SCAN

    I added the portb.5 so I could flash an LED to indicate the loop is running, which it does.
    Still have no ouput on portb.0 to portb.3. The porta inputs are tied high with 10K resistors to +5v
    Last edited by KD6OJI; - 10th December 2005 at 02:38.

Similar Threads

  1. Erratic analog inputs .
    By timseven in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 10th October 2009, 22:34
  2. inputs on 12F675 (or for that matter any PIC)
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th April 2007, 19:43
  3. Using portb as inputs PIC goes crazy
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th November 2005, 14:15
  4. SERIN2 not working with 16F628
    By d1camero in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 20:37
  5. 16F628 on-chip eeprom problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 4th March 2004, 07:43

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