Thanks for replying Myke - infuriating hobby isn't it!! You are the second person to have mentioned the 256 instruction problem! The first line of my program that controls things is at 0B2H in memory (ie. 178). At 0H there is a GOTO 0B2H effectively. All of the subroutines: ie. of form: NAME_OF_FUNCTION ; some code RETURN are between 05H and 0B1H There are plenty of calls after 0FFH (256) that work, but some do not appear to!! By trial and error I have shuffled things around, but I am still concerned about potential bugs (particularly as it will be riding in a rocket doing Mach 1!!) I do not change the program counter or have table reads (at least not intentional!) I guess this mystery may go unsolved..... Thanks for your interest, Steve ----- Original Message ----- From: myke predko To: Sent: Saturday, March 10, 2001 4:47 PM Subject: Re: unpredictable PIC behaviour > Hi Steve, > > Two things I'm not sure of: > > 1. Do you have any tables or change PCL directly in your code? As was > discussed in the thread about code commenting, the point was made that my > code would only work if the table was located in the first 256 (0x0100) > instructions. > > 2. What does your first five or six instructions look like? This goes with > the previous point, but if you are accessing tables in an interrupt handler > (which itself is jumped to), all bets are off. > > myke > ----- Original Message ----- > From: "Steve Parker" > To: > Sent: Saturday, March 10, 2001 7:43 AM > Subject: unpredictable PIC behaviour > > > Hi everyone, > > I have been having a lot of problems programming a PIC12C671. > Basically, the behaviour of the code is dependent on the order > of the sub-routines in MPLAB. Some routines fail to work when > in some positions. All functions have individually been shown to work. > The functions being called are located one after another from > ORG 05 and the main control loop starts after the last subroutine. > > I am aware of paging, but I am not sure whether this effects this chip. > I have managed to get it working by putting some of the functions > in-line (i.e. don't call them, just write them out in full when needed). > When the software simulator (MPLAB) is run everything seems fine. > I use the power up timer and the internal RC oscillator fuse settings > so that two pins are freed up for I/O ie the MCLR and the oscillator > pins become available. > > My s/ware that does the burning (PICPROG by Forest) says the last > address of my code is 0210. > > Any ideas/explanations would be great. > > Many thanks, > > Steve > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.