PDA

View Full Version : Migrating PIC16F876a to PIC18F252



cohenjdc
- 1st June 2007, 12:55
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

skimask
- 1st June 2007, 13:29
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

T.Jackson
- 1st June 2007, 13:38
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>

Acetronics2
- 1st June 2007, 13:53
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 !!!

T.Jackson
- 1st June 2007, 13:55
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 ...:|