Migrating PIC16F876a to PIC18F252


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Posts
    2

    Default Migrating PIC16F876a to PIC18F252

    Using PicBasic Pro 2.43 I've migrated from a PIC16F876a to PIC18F252 to take advantage of additional code space.

    The PIC18F252 seems to always find the following statment to be TRUE regardless of the magnitudes of the values, i.e.:

    IF (frequency < threshold) THEN GoTo main

    Elsewhere, in my code, the variables "frequency" and "threshold" are functioning properly when manipulated mathmatically; however, the IF ( ) THEN statements are not fully reliable.

    Has anyone had experience such as this?

    Thank you,
    Jeff
    Last edited by cohenjdc; - 1st June 2007 at 13:08.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cohenjdc View Post
    Using PicBasic Pro 2.43 I've migrated from a PIC16F876a to PIC18F252 to take advantage of additional code space.
    The PIC18F252 seems to always find the following statment to be TRUE regardless of the magnitudes of the values, i.e.:
    IF (frequency < threshold) THEN GoTo main
    Elsewhere, in my code, the variables "frequency" and "threshold" are functioning properly when manipulated mathmatically; however, the IF ( ) THEN statements are not fully reliable.
    Has anyone had experience such as this?
    Thank you,
    Jeff
    Nope, I've used PBP with the '452 (same basic thing) without a problem for years.
    Get the upgrade, $25/S&H @ MELabs.com

  3. #3
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default Upgrade

    Suggest upgrading to the current version 2.47 ...

    <h4> A Glimpse at What Version 2.44 Offered / Corrected</h4>
    <ul>
    <li> Adds support for PIC16F54, 57, PIC18F2439, 2539, 4439, 4539, 6520, 6525, 6585, 6621, 6680, 8520, 8525, 8585, 8621 and 8680.</li>
    <li> Adds REPEAT..UNTIL.</li>
    <li> Adds 9 bit parity to HSERIN, HSERIN2, HSEROUT and HSEROUT2.</li>
    <li> Changes PIC18Fxxxx DATA and EEPROM to allow odd locations.</li>
    <li> Fixes constant folding for large numbers.</li>
    <li> Fixes unable to load COD file for MPLAB 6.</li>
    <li> Fixes parity with timeout in serial instructions.</li>
    <li> Fixes PIC18Xxxxx DEBUGIN modifier timeout.</li>
    <li> Fixes PIC18Xxxxx SERIN2 DEC modifier timeout.</li>
    <li> Fixes PIC18F1220 and 1320 configuration error.</li>
    <li> Fixes PIC18F6620, 6720, 8620 and 8720 BANK12 RAM setting.</li>
    </ul>
    Last edited by T.Jackson; - 1st June 2007 at 13:39. Reason: Add title

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Question PbP version involved ????

    Hi, Jeff

    I had such a behaviour and related it on this forum ...

    No help went ...

    but simply changing subs position cancelled the problem ( test was located in a sub, at the very end of the program !!! )

    Alain

    PS: archive only keep 500 posts ... was written before !!!
    Last edited by Acetronics2; - 1st June 2007 at 14:32.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post Could be a bug in PBP, don't ever close your mind to it.

    I personally have about 99% faith in PBP. No technology in this World is 100% reliable. While I've never actually discovered a bug in PBP myself, I have found a few in Visual Basic. Very strange - I wrote this rather lager program and, I had a variable named (LoopX) used extensively throughout with (For Nexts) Cut a long story short, in one procedure this variable refused to work. Always returning zero. It was globally declared as an integer. After many black cups of coffee and a lot of lost hair I decided to introduce a new variable into the scope of things, variable called (LoopZ) The procedure began to miraculously, flawlessly perform.

    Go figure ...:|
    Last edited by T.Jackson; - 1st June 2007 at 13:56. Reason: typo

Similar Threads

  1. Problem with ASM IRQ using FSR0 on PIC18F252
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th March 2008, 20:48
  2. Runing a PIc16F876A
    By lerameur in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 7th January 2007, 12:54
  3. pic18f252 hserout problem
    By edysan in forum Serial
    Replies: 4
    Last Post: - 16th June 2006, 20:46
  4. PLEASE HELP ME! pic16f876a and AD tlc4541
    By luca_sheva in forum mel PIC BASIC
    Replies: 1
    Last Post: - 1st February 2005, 17:32
  5. how to get PCF8574 and PIC16F876A work together
    By nomada in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 02:07

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