Problem with A port on 18F2550


Results 1 to 19 of 19

Threaded View

  1. #1

    Default Problem with A port on 18F2550

    I have a problem with my a port on the 18F2550 device. When i use this code the a port will toggle all the time. What do I wrong.

    I have the following code:

    Include "modedefs.bas"

    Define OSC 20
    DEFINE DEBUG_REG PORTC
    DEFINE DEBUG_BIT 7
    DEFINE DEBUG_BAUD 9600
    DEFINE DEBUG_MODE 1

    LEDGroen VAR PORTB.7
    LEDRood VAR PORTA.2


    Relais1 VAR PORTA.5 ' Relaiscontact'

    LATA = 0


    ADCON1 = 7 'poort a op digitaal
    'ADCON1 = 0 'poort a op analoog

    ADCON0 = 0
    ADCON2 = 0

    'CMCON = 7


    TRISB.3 = 1 'Input
    TRISB.2 = 1 'Input
    TRISA.1 = 1 'Input

    TRISA = 255


    DEFINE ADC_BITS 8 ' Set number of bits in result (8, 10 or 12)
    DEFINE ADC_CLOCK 2 ' Set clock source (rc = 3)
    DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds

    Init:

    HIGH LEDGroen
    PAUSE 500
    LOW LEDGroen
    Pause 500
    HIGH LEDRood
    PAUSE 500
    LOW LEDRood
    Pause 500
    Debug "->Start<-", 13,10

    Goto Main


    Main:
    High Relais1
    Goto Main:
    Last edited by NL2TTL; - 7th May 2007 at 18:19.

Similar Threads

  1. Array problem (18F2550)
    By Ronald123 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th January 2008, 18:47
  2. Setting up Port b for I2C on 18f2550
    By rjones2102 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd October 2007, 20:22
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. PWM problem CCP2 port
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 19th September 2006, 23:34
  5. COM port problem
    By andys280176 in forum Serial
    Replies: 0
    Last Post: - 19th January 2006, 16:42

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