Searching \ for 'Code runs perfect in MPLAB but won't run in PIC !' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=mplab
Search entire site for: 'Code runs perfect in MPLAB but won't run in PIC !'.

Truncated match.
PICList Thread
'Code runs perfect in MPLAB but won't run in PIC !'
1998\03\10@151858 by James & Ili

flavicon
face
Does this sound right? I have put together a little program that
counts from 0 to 9999, it sends out 4 bytes via 9600 RS232 each time
it increments. Most of the routines have been used in other programs
and worked flawlessly in them. I have moved the sub-routines around
thinking that maybe it didn't like the order but nothing. It does the
first digit. I.E. it outputs a 0 then stops with the pin high.
Running it in the MPLAB simulator it works great. Any suggestions ?
       Thanks in advance !
James Holbrook

1998\03\11@060452 by m00c0600

flavicon
face
James & Ili wrote:
>
> Does this sound right? I have put together a little program that
> counts from 0 to 9999, it sends out 4 bytes via 9600 RS232 each time
> it increments. Most of the routines have been used in other programs
> and worked flawlessly in them. I have moved the sub-routines around
> thinking that maybe it didn't like the order but nothing. It does the
> first digit. I.E. it outputs a 0 then stops with the pin high.
> Running it in the MPLAB simulator it works great. Any suggestions ?
>         Thanks in advance !
> James Holbrook

When this happens to me, it is usually an initialisation problem.

On the simulator, the RAM, etc.., is initialised repeatably from the
start of simulation.

On a real chip, the RAM will usually power up at 0FFh on the OTP chips,
but not always, and on the -JW windowed dev. chips, it tends to come up
a 000h, unless you are in total darkness! This is due to the effect of
light coming through the EPROM window, (even with paper label) and dis-
-charging the RAM cells during power-up.  A little light does not SEEM
to cause misoperation, however.

jim ford

1998\03\11@132743 by Tom Handley

picon face
  James, which PIC are you using? Was the previous code running on
another member of the PIC family? There are a lot of possibilities
here including a simple mistake in moving your routines from other
programs. You mentioned "Most of the routines" so your new routines
may be in error. Moving the subroutines around would only be a
problem if you crossed a code page boundry. For 16C5x and 12C5x devices
that boundry is 256 Bytes. For 16C6/7/8/9x and 12C6x devices it's 2048
Bytes. If this is the case, you need to manipulate the PAx Bits in the
STATUS register for the 16/12C5x or PCLATH for the other devices.

  - Tom

At 02:19 PM 3/10/98 -0600, you wrote:
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...