One of those days... config question


Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Jul 2011
    Posts
    35

    Red face One of those days... config question

    Hi,

    I'm trying to use a PIC18F2420 and configure all pins on PortB to be digital I/O's. I usually follow the datasheet quite literally, so have configured port b as follows:

    @ __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L ;LV PROGRAMMER OFF

    ASM

    ;PORT B
    CLRF PORTB
    MOVLW 11111111b ;ALL PORTB PINS DIGITAL
    MOVWF ADCON1 ;A/D'S OFF
    MOVLW 11000000b ;PIN DIRECTION PORT B
    MOVWF TRISB

    ENDASM

    After doing this, I'm trying to toggle PORTB.5 with just a short loop:
    START:
    HIGH PORTB.5
    PAUSE 100
    LOW PORTB.5
    PAUSE 100
    GOTO START

    It absolutely doesn't budge.
    Would someone please tell me what I missed? It's been one of those days.
    Thanks much!
    Last edited by LGabrielson; - 15th May 2012 at 03:24.

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