I would suggest: - Create a generic interface for the component you try to use in such a way that it's not tied to your specific processor. This can be a set of functions or a class-oriented interface. Preferably make the group self-contained, IE, use a handle + associated storage space to store settings, buffers and so on, so you can instantiate more than one of the object type. - Create a specific implementation of the interface for your given processor. - Give your implementation compile-time checks and errors if it cannot work on the given target (#if !defined(UCHIP_PIC) || !defined(PIC16F688) #error Can't work. #endif) - Give the module preconditions and postconditions for all functions, plus check all the invariants of the module. Add this code so that it's easily removed for production code. - Use the components and if they give errors, fix them. For later use: - When creating a new implementation of an existing component, see if you can genericize over a family of chips instead of another single chip. Please do note that "interface" stands for the generic concept, so you can do this in assembly exactly as easily as in any other language. Regards, Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist