Read the newbee threads, 16F877A no go.


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Default More on the configuration bits.

    Looking further into the configuration bits only confuses things more. From Melanie's thread on setting them up, I looked at the .inc for entries matching the datasheet's Special Features section. The datasheet calls out many configuration bit switches that are not addressed in the .inc file.
    I'm really hoping these bits are not important to be set or cleared, otherwise it doesn't inspire confidence. I still have little idea on what the configuration bits should be set to. Learning more every day...

    Bobby

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Did you read the whole thread??? I post some info myself too
    here

    So can we assume that something is working now on your side???
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Default It lives.

    The short test program included in my first email will run now.
    A number of changes were made, including editing the \PBP\xxxxxx.inc file.
    Also turned off the watchdog timer, I may turn it back on to check effect.
    Somewhere along the way I've hosed up the MPASM configuration and now
    will have to get it working again. But hey this is a learning process right ?

    Thank you for the help.
    Bobby

  4. #4
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Default Still learning.

    I switched the wdt_ configuration back to on, and the toggle program still runs.
    The larger program even executes, more or less.
    The less part is that I'm required to press the reset button to get my program to run, where the original development board firmware executes on powerup.
    Any suggestions where to start looking ?

    Thanks,
    Bobby

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    ARGH, are you using some kind of bootloader??? if so add
    DEFINE LOADER_USED 1
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Default No autostart

    Thanks for responding.

    No, I'm not using a bootloader.

    I'm really surprised how poorly this has gone. There are a couple of guys at work who program PICs, they program strickly in assembly. I wondered why they went through all the trouble, at least when assembly wasn't actually required for speed or code size.

    The answer is, because the higher level tools aren't ready for prime time.
    I can't believe all the convoluted ways to do things I've looked up, which also happen to not work right or as often as not don't work at all.

    Sure this is frustration talking, but changing DEFINE OSC 12 to DEFINE OSC 11 (actual clock is 11.0592 MHz) results in 8 assembler errors, minor variations of:
    Error c:\pbp\pbppic14.lib 2827 : [225] Undefined Symbol 'PAUSEUS'

    and still no readable serial characters (at least with any communication protocol from this planet).

    And who's idea is that of a useful or appropriate error msg ?

    Bobby

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Unfortunately you can't use DEFINE OSC 11

    all available crystal speed are 3(3.58) 4 8 10 12 16 20 24 25 32 33 40

    so this is one part of your problem. You'll use a DEFINE OSC of 10 or 12. Yep, all the timing will have to be adjusted by yourself but it's not a so much big deal.

    to make it work properly, i'll suggest you use the internal USART modules and the dedicated TX/RX pins. Try something like
    Code:
    DEFINE OSC 10
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 71 ' 9600 Bauds @11.0592 MHZ
    DEFINE HSER_CLOERR 1
    
    Start:
          Hserout ["Serial comm test @9600 bauds",13,10]
          pause 500
          goto start
    about now???
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    > the higher level tools aren't ready for prime time.

    Many hundreds if not thousands of PICBasic users would probably take issue with that statement. My royalty cheques are a reminder that PICBasic works real well. A little time getting to know the product properly will be beneficial.

    > but changing DEFINE OSC 12 to DEFINE OSC 11 (actual clock is 11.0592 MHz) results in 8 assembler errors

    DEFINE OSC 11 is an illegal setting. I refer you to my previous statement of getting toknow the product.

    > The datasheet calls out many configuration bit switches that are not addressed in the .inc file.

    For 18F series PICs you will be using MPASM Assembler and not the PM Assembler. You need to locate the appropriate INC file located with MPASM. All the valid Configuration Fuse defines will be located theirin which can be cross-referenced with the PICs Datasheet.

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


    Did you find this post helpful? Yes | No

    Default one idea

    Quote Originally Posted by BobbyA View Post
    The less part is that I'm required to press the reset button to get my program to run, where the original development board firmware executes on powerup.
    Any suggestions where to start looking ?

    Thanks,
    Bobby
    Hi Bobby A,
    I agree with you about the books and manuals ability to convey everything a newbie needs to learn, they basicly blow! This forum is very helpful, very many smart people here!
    For the problem above try putting a capacitor of say 1uf from the reset pin to ground. the time it takes to charge through the resistor you have going to B+ will allow the PIC to stabalize on start up. It seems some individual pic chips need this, I do not know why . . . maybe est damaged? Just curious are the chips you are using samples?
    JS

  10. #10
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Default

    Kind of late responding, but the forum just sent out (in Dec) an email notice there were 4 post to the thread (last in Aug ?). Procrastinator club anyone ?
    Anyway, it's not ic specific since the original demo program that came with the board can be reloaded (external device programmer) into the exact same ic and it will run from power up. But the PBP compiled program does not start to execute until the reset button is manually pressed.
    I don't know what the real cause was, eventually I chucked the board, PBP, and Hellebuyck's book in a drawer, and things got better.
    Cheers, Bobby
    PS. Royalty checks only prove people bought it, not that they found it useful.

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


    Did you find this post helpful? Yes | No

    Default

    > Procrastinator club anyone ?

    Since nothing had been heard over this time I for one assumed your problem was solved.

    This year marks six years since I started playing with PICs and PBP. Three hundred designs later (averaging one a week - and if it had a PIC in it, then it was driven by PBP) and close to a million PICs shipped, I have to admit that whether folks found the products useful or consigned them to land-fill that I really don't care.

    In all that time, I've never had a customer return that was attributable to design, manufacturing or component defect. I put this down in the main that some of the products are large and heavy >2000kg and Mr Postman just can't fit them through the letterbox. But if they end up useful as boat-anchors, then that's still a success in my book.

    What I can say with absolute certainty is that the PBP component works - as do the PICs. That leaves a failure to understand hardware, designs, not reading Datasheets or Manuals or defective logic in coding. A look on the kind of posts on this forum tells you that this accounts for 95% of help requests. PICs only need three things to make them work, POWER, RESET and CLOCK (OK, and a half-sensible program too). I don't know your Development Board, but if you can't even get a simple LED to blink in order to verify that those three conditions to make the PIC run have been met, or have the knowledge to determine which of those three are causing you grief, then chucking everything in a drawer and concentrating on watching Bonsai grow is the way to go. That may be a little strong language for this festive season (even if it is intended in jest), but seriously, PICs will do one of two things for you, they'll either make you very rich, or cause you to lose all your hair. I'd rather everyone was in the former category than the latter - and the secret to making everything work is contained in this paragraph.

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. Q: using MCLR for Input on 12F683
    By picster in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 31st January 2009, 15:25
  5. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34

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