Blink that LED with a 18F1330


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    937

    Default Blink that LED with a 18F1330

    Hi All,

    I'm desperate

    I'v spend hours and hours trying to make that LED blink on my 18F1330 but nothing does.

    I even use this code here, the one from MELABS and still, the LED stays OFF.

    Code:
    ' Name        : BLINK.pbp
    ' Compiler    : PICBASIC PRO Compiler 2.6
    ' Assembler   : PM or MPASM
    ' Target PIC  : 16F or 18F types
    ' Hardware    : Non specific
    ' Oscillator  : internal or external
    ' Keywords    : BLINK LED
    ' Description : PICBASIC PRO program to to blink an LED connected
    ' to PORTB.0 about once a second
    '
    
    'The following program is a simple test to blink an LED on and off.  Select a
    'device in the dropdown list above, then click the Compile Only button on the 
    'toolbar to compile the program and generate a hex file.
    
    ' Configure pins for digital operation (uncomment as needed).
    ' These settings are intended as simple examples.  For more detail,
    ' see the appropriate device datasheet for register descriptions.
    'ANSEL =  %00000000  ' 16F88, 16F688, 16F690, 16F88x
    'ANSELH = %00000000  ' 16F690, 16F88x
    'ADCON1 = %00000111  ' 16F87x, 16F87xA, 18F452
    'ADCON1 = %00001111  ' 18F4620 
    
    LED    VAR  PORTB.0   ' Assign name "LED" to PORTB.0
    
    mainloop:
       High LED        ' Turn on LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
    
       Low LED         ' Turn off LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
    
       Goto mainloop   ' Go back to loop and blink LED forever
       
       End
    I'm using a 8MHz crystal connected to pins 15 and 16 and the LED is on pin 8 and GND.

    I hate to say it but I checked the "hardware" with GC and it is okay, it works fine.

    But what is wrong or missing here please?
    Roger

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,057


    Did you find this post helpful? Yes | No

    Default Re: Blink that LED with a 18F1330

    There are no config settings.

    Try to find the appropriate for your application. There are a bunch of them!

    Ioannis

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    937


    Did you find this post helpful? Yes | No

    Default Re: Blink that LED with a 18F1330

    ...forgot these "friends" again

    Working now...
    Roger

Similar Threads

  1. PIC 18F1330 - first time, hard time - blink that LED
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st March 2015, 23:33
  2. need led blink program
    By asifiqbal in forum General
    Replies: 6
    Last Post: - 4th March 2014, 12:26
  3. Newbie: Trying to blink a LED
    By JackPollack in forum General
    Replies: 6
    Last Post: - 29th March 2007, 07:31
  4. 10f206 Blink led
    By Bonxy in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th November 2005, 21:01
  5. Can't get a 12F629 to blink a led
    By Sharky in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th June 2005, 12:28

Members who have read this thread : 6

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