I'm using PBP 2.47 and microcode studio 2.3.0.0, to write code for a 16f877a.

I have a large polling loop that includes 18 of these structures:

if T_zone > 0 and current_zone = 1 then
high P_Zone1
else
low P_Zone1
endif

if T_zone > 0 and current_zone = 2 then
high P_Zone2
else
Low P_Zone2
endif

...
if T_zone > 0 and current_zone = 17 then
high P_Zone17
else
low P_Zone17
endif

if T_zone > 0 and current_zone = 18 then
high P_Zone18
else
low P_Zone18
endif

What I find is when I set the current_zone to 17, the output will toggle. All other outputs in this loop don't. Also, when swap the location of the zone17 and zone18 code, zone 18 toggles and zone 17 doesn't.

I have written a few lines of code to go through and test the fact that all the I/Os are working so I haven't blown a driver, or have a weak one.

I have to believe that it has something to do with the fact that the program is on the large-ish size (2370 words). I am not using any branch statements, it's all gotos and gosubs.

I would be happy to include the entire source code if someone thinks they have a good idea as to what would cause it.

thanks