Good day to all. I've been struggling for the past many weeks trying to get my head=20 around structuring my code around the relocatable paradigm. Thanks=20 to help from people here as well as the many Internet resources, I=20 think that I've mostly got a handle on it. In particular, Jan-Eric's=20 web pages about the differences between absolute and relocatable code=20 and Olin Lathrop's PICdev stuff have been invaluable. But - I'm having really strange problems and I can't figure out what=20 I'm doing wrong. This particular project is using 16F1782 and I'm currently using a=20 PICkit 3 for debugging. First: I should mention that I'm not using Microchip's include=20 files. Instead, my source code contains every register and bit=20 explicitly defined. This is a carryover from the days when=20 Microchip's include files were riddled with errors and I just haven't=20 bothered to change my way of doing things. One advantage is that=20 each bit is described so that I can easily create or understand what=20 is happening with each byte / configuration register. The other=20 advantage is that the register address is explicitly embedded into=20 the bit name - this means that I call the bit name and the register=20 address is automatically populated. I find this to be an enormous=20 time saver and error-eliminator. Now to my problem. I have two identical versions of my code: one=20 written the way I have been doing all these past many years in=20 absolute mode. The other version has been modified to be=20 relocatable. Both compile (assemble) without errors and the version=20 written for absolute mode works correctly (so far - I'm still=20 debugging). But the version written in relocatable mode is having=20 issues. Hardware-type issues. Here's a brief description of some of the problems that I'm seeing. All 8 pins of port RA feed the segments of a 4-digit multiplexed=20 common-cathode 7-segment display. Pins RC0..RC3 feed the digit=20 select pins of the display. 1) Pin RA7 tris bit appears to be always set. I wasn't sure if my=20 problem was with the tris bit or the odcon bit but I have verified=20 that the pin appears to be an input rather than just open-drain. Symptom: none of the "A" segments (top row) on the display light up=20 for any of the 4 digits. I set a breakpoint just before that digit=20 gets written and have the following registers in my watch window:=20 WREG, PORTA, LATA, TRISA, ODCONA. As I single-step, I see that W is=20 loaded with the correct data (numeric digit "3"), that value is=20 written to LATA but PORTA bit7 remains LO. TrisA & ODconA are all at=20 0x00 (all CMOS outputs). If I inject a small current onto pin RA7, I=20 see the segment illuminate. So: that means that either the pin is=20 Open-Drain (can't source current) or an input (Tris bit RA7 is=20 HI). While the program is still halted, I simply change the value of=20 port RA to 0x00 and try to inject current into each of the port RA=20 pins. All pins except RA7 are outputs (and LO) but RA7 is an input. Symptom: After playing around with the above for a while, I add all=20 of the registers for port RC to the watch window. Reset the PIC back=20 to the beginning and run to the breakpoint where digit 3 is about to=20 be illuminated. Single-step to the point where digit 3 is=20 illuminated and I observe that the appropriate digit-select line on=20 port RC is NOT correctly showing the state of that bit: all 4 digit=20 select lines are shown as being HI instead of 3 bits HI and one bit=20 LO. This is obviously not correct because the digit on the display=20 is illuminated, which means that the digit select line is LO. But it=20 is not shown that way in MPLAB. All of the above problems go away if I go back to the version of code=20 written in absolute mode. Why this is important to me (and this project): I want to be able to=20 use the Emulation Debug Module for this processor family=20 (AC244064). This gives the PICkit3 up to 32 available breakpoints=20 (instead of just 1) and if I use one of my Real-ICE units, gives me=20 pretty much all of the functionality of the ICE2000 (nested=20 breakpoints, etc). But that AC244064 works only with MPLAB-X and=20 MPLAB-X now appears to work only with relocatable code. I'm obviously doing something wrong but I just can't see=20 it. Guidance appreciated. Many thanks! dwayne --=20 Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA 780-489-3199 voice 780-487-6397 fax 888-489-3199 Toll Free www.trinity-electronics.com Custom Electronics Design and Manufacturing --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .