18F2510 help


Closed Thread
Results 1 to 8 of 8

Thread: 18F2510 help

  1. #1

    Default 18F2510 help

    Hello Everyone. I recently added code to a program compiled for a 16F76 and it wouldn't fit in the PIC. So I compiled it for a 18F2510 and the timing seems to be off. Certain sections of the code seem to run slower while other sections run a little too fast. Does anyone have any suggestions? I changed adcon1 = 7 to adcon1 = 15 for the 18F PIC. I also had to remove my @device line to compile without errors. I then set the config bits within MPLAB before programming. Thank you.

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


    Did you find this post helpful? Yes | No

    Default

    Just make sure that all register match from one to another. Sometimes, some specific bits on a device are not located at the same place on another one.

    If you don't mind, post your code here.
    Steve

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

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thanks Steve. One interesting thing is the beginning of the program runs slow - delays that are supposed to last only 1/2 second take 2 seconds to complete. I was able to eliminate this by changing the Watchdog Postscaler from it's default of 1:128 to 1:8. However, later in the program there are delays that are supposed to last up to 6 seconds but finish in about 4-1/2 seconds. Any ideas?? - Thank you.

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


    Did you find this post helpful? Yes | No

    Default

    I didn't check the datasheet but, are you using the internal OSC (if there's) ?

    try the eternal Led Blink first and post your observations here.
    Steve

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

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Hi Steve. The circuit uses a 4MHZ ceramic resonator. Again, the 16F76 worked perfectly until I compiled it for 18F2510. I must be missing something???

  6. #6
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peterdeco1 View Post
    Hi Steve. The circuit uses a 4MHZ ceramic resonator. Again, the 16F76 worked perfectly until I compiled it for 18F2510. I must be missing something???

    How are you implementing the delays?

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


    Did you find this post helpful? Yes | No

    Default

    Weird,
    your ADCON setting is good, the comparator are off at POR... so...

    Any way to post your config fuses setting here?
    Steve

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

  8. #8


    Did you find this post helpful? Yes | No

    Default

    What is so weird is that both delays are implemented the same way using the pause command. Changing the Watchdog Postscaler from 1:128 to 1:8 speeds-up one but not the other. The timers are basically like this:
    timer:
    pause 60
    let x = x + 1
    if x >= 100 then blahblah
    goto timer

    This 6 second routine is exactly 6 seconds with the 16F76 but is about 4-1/2 with the 18F2510. Changing the Watchdog Postscaler has no effect on this one. Now this 500 MS routine takes 2 seconds and speeds-up to 500 MS with the Postscaler set to 1:8:

    if porta.5 = 0 then pause 500 : goto start

    I was hoping I was missing something (never used an 18F before). But it looks like it's time to order some new PIC's (I only have 1) I was driven crazy 2 times before by what turned out to be a bad PIC. It's that time of year here when everytime you touch a doorknob you get a shock. Maybe I toasted it. Thanks for the help everybody.

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