Getting started with Chuck Hellebuyck


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    8

    Angry Getting started with Chuck Hellebuyck

    I have programmed a pic to flash one Led from the book by Chuck. I have used copy and paste so it must be ok. I have programmed the chip having set the fuses to __CONFIG _CP_OFF & _WDT_off & _BODEN_ON &_PWRTE_ON & _HS_OSC & _LVP_OFF &_DEBUG_OFF
    I have built the circuit which is perfect but when it is switched on the led lights and stays on. I have changed the 4mhz resonator but it made no diference it still stays on. I have grounded both the legs of 4mhz with 68p capacitors I presume this is correct. This is what I have programmed in. I cant see where I could have gone wrong. Thanks to anybody who can help.


    symbol LED = 0 'Rename pin 0 of portb (PIC 16F876 pin 21) to LED

    TRISB = %11111110 'Setup port b as RB7-RB1 inputs, RB0 as output
    main: 'Label for beginning of main loop
    High LED 'Set pin 0 of portb high (5 volts) which turns the LED on
    pause 1000 'Pause 1000 milliseconds (1 second) with LED on
    Low LED 'Set pin 0 of portb low (0 volts) which turns the LED off
    pause 1000 'Pause for 1 second with LED off
    goto main 'Jump to the main label and do it all again and again

    END 'This line is not needed but its safe to put it here just in case
    ' the program gets lost.


    Thanks Ged.

  2. #2
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA.
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    I'm going to guess that the problem is with the Symbol statement. Please try
    LED var portb.0 and see if that works. Symbol is a Basic Stamp 1 command, and personally I have never used it. You could also try adding another pause 1000, I've had it where the led was turning on and off so fast that I thought it was on all the time.

    Good Luck,

    Jerry.
    If your oscilloscope costs more than your car...

  3. #3
    Join Date
    Mar 2008
    Location
    Gerogetown, Texas
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    If you are using a 4Mhz crystal or resonator you need to set the config to
    Code:
     XT_OSC not  "HS_OSC"
    Give that a try

    Dave

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi quester,
    double check the connections of your breadboard, especially if it is an old one. Pay particular attention to the pins associated with the oscillator pins and resonator.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Feb 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Solved

    I have changed Chucks first line project 1 from Symbol LED = 0 to LED var portb.0 and it now works I have just tried his second project using a for next loop and it does not work as it should. Do you think the problem could be my programmer or is there more than one version of Picbasic Pro.
    Has anybody bought Chucks book and worked through the projects with success.
    I tried the other mode and it works just the same thanks XT_OSC not "HS_OSC"
    Thanks to everybody.

    Quester
    Last edited by quester; - 9th March 2008 at 20:24.

Similar Threads

  1. Trying to get started w/ HPWM
    By circuitpro in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 20th February 2010, 18:42
  2. getting started
    By cunninghamjohn in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th November 2008, 18:42
  3. Getting started... again...
    By Neosec in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 31st May 2008, 02:09
  4. Getting started with Chuck Hellebuyck fuses
    By quester in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th March 2008, 03:47
  5. How did you get started .....
    By keithdoxey in forum General
    Replies: 25
    Last Post: - 13th April 2007, 19:29

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