Help with simple program


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Location
    I'm From Krooklyn
    Posts
    3


    Did you find this post helpful? Yes | No

    Default O.k.

    Humm, yeah, now I know what you mean. I will read the faq and become a bit more informed about the rules. Sorry.
    As far as the "config fuses" setting: isn't this set when I chose the pic16f877A I.C. before compiling with picbasic pro with Microcode studio? I'm really, really new to this and I'm trying to get a steady footing (basically I'm balancing myself on a tooth pick with my big toe). Thanks for the help. I will try to hammer out the details through trial and error.

    Peace.

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


    Did you find this post helpful? Yes | No

    Default

    Welcome to the world of PICs.

    The fuses or configs are set once at program time. Each chip has similar settings but some have more or less. ??

    Example, the type of OSC used is set here, not the speed. Settings can be anything from internal, RC, crystal, or resonator. This is where the data sheet comes in handy.

    The thread that Joe pointed to tells how to set the fuses in the code. When you read the thread and get to the post from misterE you will notice the *.inc file mentioned. The *.inc is the main fuse file for PBP. You can change things there and not have to put the settings in each code. Either way has advantages.

    When you post problem code, it will help if you post all of it, not just the part you think is the problem, also it helps if you tell a little how you have it connected to other parts.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mykewl View Post
    Humm, yeah, now I know what you mean. I will read the faq and become a bit more informed about the rules. Sorry.
    As far as the "config fuses" setting: isn't this set when I chose the pic16f877A I.C. before compiling with picbasic pro with Microcode studio? I'm really, really new to this and I'm trying to get a steady footing (basically I'm balancing myself on a tooth pick with my big toe). Thanks for the help. I will try to hammer out the details through trial and error.

    Peace.
    No need for apology ! I was Grinnin' like the Cheshire cat when I wrote that The inc file Mackracket refers to has a Config setting by default, maybe not what you want. I think it is there so newbies can get their first projects going, assuming they use 4mhz resonators. You may want a 20 mhz osc, or turn WDT on or off or not use MCLR line as reset. That's why we comment them out and set them in every program, I usualy cut and paste from a prior project, only trips me up when I use a different PIC then I go look up the proper syntax. I use only MPASM not PM as assembler. Why, because most of the people here who are willing to help use MPASM and it makes my code instantly compatible, also less junk to type, and it is the OFFICIAL assembler of MICROCHIP. There is a whole bunch of good information in the FAQs, the stuff all the books out there forgot.
    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.

  4. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    I do not know if your Configs are correct but you have additional problems ...

    On the 877A

    High 0

    sets PortB Pin 0 high, not PortC, Pin 0. See manual section 4.11 and then implement Melanie's suggested fix above for this.

    Good Luck
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    To get you started, here's a set of Configs for the 876A (you can easilly change this for 877A) to be used with the MELABS default PM Assembler (not Microchips MPASM)...

    Code:
    	@ DEVICE pic16F876A, HS_OSC		' System Clock Options	
    	@ DEVICE pic16F876A, WDT_ON		' Watchdog Timer
    	@ DEVICE pic16F876A, PWRT_ON		' Power-On Timer
    	@ DEVICE pic16F876A, BOD_ON		' Brown-Out Detect
    	@ DEVICE pic16F876A, LVP_OFF		' Low-Voltage Programming
    	@ DEVICE pic16F876A, CPD_OFF		' Data Memory Code Protect
    						' Set to CPD_ON for Release Copy
    	@ DEVICE pic16F876A, PROTECT_OFF	' Program Code Protection
    						' Set to PROTECT_ON for Release
    	@ DEVICE pic16F876A, WRT_OFF		' Flash Memory Word Enable
    Now call me old-fashioned, but I don't use Microcode Studio... and I would compile my program from a Windows DOS box with the command line...

    PBPW -p16F876A myprogram -v

    If your program is small, you can also use...

    PBP -p16F876A myprogram -v

    but once it's complexity exceeds a certain limit, you will get "Out of Memory" errors when you compile, and you'll have to use PBPW rather than just PBP.

Similar Threads

  1. Simple Blink program doesnt work.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st March 2009, 20:30
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. simple counting program - please help!!
    By john meiers in forum mel PIC BASIC
    Replies: 3
    Last Post: - 20th February 2006, 13:17
  4. Simple RS232 Program
    By BlackNoir in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th January 2006, 00:57
  5. Simple Interrupt Program
    By eoasap in forum General
    Replies: 5
    Last Post: - 28th October 2005, 16:22

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