Help Getting Started


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    7

    Default Help Getting Started

    I'm right out of the starting gate with PIC programming but did BASIC on punch cards in college 35 years ago. Frustrated, and would appreciate some help.

    Just bought the LABX-1 Board, PicBasic Pro and Melabs U2
    Using a 16F877a
    Here is my program

    clear
    adcon1 = 7
    mainloop:
    high portd.0
    Pause 500
    low portd.0
    pause 500
    goto mainloop
    end

    The compiler says that it is compiled successfully and then it loads via the USB ME LABS PROGRAMMER into the X-1 without error, but nothing happens when I load it into the board/chip. When I look at the memory tab of the programmer, I see that a hex file was created. Yes, I have checked to be sure that the polarity of the led bar graph and the JP2 jumper are correct. I have even tried it using low portd.0 just for giggles, and that doesn't work either. I've tested the programmer and the board/chip using the board test program that was included with the board (in hex) and the board runs fine, making the leds blink, lcd display, etc.

    I've read and reread the book but can't find what I'm doing wrong. Sorry to trouble you all with such a basic question, but my head hurts from banging it in the wall.
    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    What are you using for an oscillator and how are the configs set?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Just starting

    Thanks for your quick reply!

    I am using the 4 MHz crystal that came mounted on the board
    The configs for the programmer are:
    Osc XT
    Watchdog Enabled
    Power-up Timer Enabled
    Brown-out Enabled
    Low Voltage Pgm disabled
    flash pgm write All
    Code NOT protected
    Data EEPROM Not protected

    I took these setting from the board test program that works

    Thanks
    Fred

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


    Did you find this post helpful? Yes | No

    Default

    Maybe try HS OSC.
    But if it worked the way you have it on the sample, it is just a guess.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Add these to you code:
    DEFINE OSC 4 ' Tells your PIC how fast it is running
    ADCON0 = 0 ' Disable A/D
    CCP1CON = 0 "Disable Comparators

    Power on.MCLR,BOD, . . . reset . . . Defaults to TRISD = %11111111
    TrisE = %00001111 FYI check Datasheet 3.5 RE: MSP if TrisE.4 is set, As a beginner, if I were you, I would park that HP Chevelle in the garage and practice in the Toyota. A 16F628A, 16F648A, or !6f690 with PICKIT2 and Demo board, Get your feet wet with those, then go back to the 877. Just my opinion.
    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.

  6. #6
    Join Date
    Aug 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Thanks

    Thanks for the advice

    I did try changing the oscillator type to HS - no luck

    I will try the other suggestions. I read a fair amount before investing and was under the impression that the 16F877a was a reasonable place to start. Maybe not!

    Thanks

    Fred

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. How did you get started .....
    By keithdoxey in forum General
    Replies: 25
    Last Post: - 13th April 2007, 19:29
  5. getting started with a PIC 18F4550
    By bigbear in forum General
    Replies: 2
    Last Post: - 16th October 2006, 02:31

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