18F2550 and Blink Led


Closed Thread
Results 1 to 40 of 50

Hybrid View

  1. #1
    Join Date
    May 2012
    Posts
    18

    Default 18F2550 and Blink Led

    Hello Everyone,

    I'm trying to configure a basic program into a 18F2550, but with no luck.

    I'm testing the code with a simulator, but nothing happens...

    Anyone could help?


    DEFINE OSC 8

    @ __CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    @ __CONFIG _CONFIG1H, _FOSC_HS_1H
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
    @ __CONFIG _CONFIG2L, _PWRT_OFF_2L & _VREGEN_OFF_2L
    @ __CONFIG _CONFIG3H, _MCLRE_ON_3H
    @ __CONFIG _CONFIG4L, _LVP_ON_4L & _XINST_ON_4L

    PORTA = %00000000 ' Turn off all PORTA
    PORTB = %00000000 ' Turn off all PORTB
    ADCON1 = %01111000
    ADCON2 = %10000111
    TRISA = %11100111
    TRISB = %11000011

    loop1:
    LATB.2 = 1
    pause 100
    LATB.2 = 0
    PAUSE 100
    goto loop1
    end


    Thanks,
    Nuno

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    Try
    Code:
    @ __CONFIG   _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    @ __CONFIG   _CONFIG1H, _FOSC_INTOSCIO_EC_1H
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2012
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    Thanks mackrackit, I try it but the same result, the pins of the Pic doesn't change state. The oscilator is a 8MHz, MCSP 3.0.0.5 Pic Basic Pro 2.60A.

    Any idea??

    Thanks,
    Nuno

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    The below works using the internal OSC for a test.
    ' PIC18F2550
    DEFINE OSC 8
    ASM
    __CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    __CONFIG _CONFIG1H, _FOSC_INTOSCIO_EC_1H
    __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H
    __CONFIG _CONFIG4L, _LVP_OFF_4L
    ENDASM

    ADCON1 = %00001111
    CMCON = 7
    OSCCON = %01110000
    TRISB = %00000000
    START

    LATB.2 = 1
    PAUSE 250
    LATB.2 = 0
    PAUSE 250
    GOTO START
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2012
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    Hello,

    Compiling it, gives me some Warnings "Found Directive in column 1.(_CONFIG), but it compile. At the oshon simulator, the same result, the pins of the microcontroller doesn't change at all...

    Thanks,
    Nuno

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    I do not use simulators, I can not help you there.

    For the warning, SPACE the
    __CONFIG
    over by one.
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 4

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