PicDude wrote: >My EE read problem was due to the address for the defaults. Now solved. > >Porting wasn't really a battle on my end, but this code (from memory) stopped >me for a couple minutes... > OW_PORT EQU PORTB ; One-wire I/O port > OW_PIN EQU D'7' ; One-wire I/O pin # > ... >OW_SetLo: > bcf STATUS,RP0 ; Bank 0 > bcf OW_PORT,OW_PIN ; Set low first > bsf STATUS,RP0 ; Bank 1 > bcf OW_PORT,OW_PIN ; Will actually tris the pin as o/p since in bank 1 > You are using a"trick" to get access to a clearly defined register. "tricks" have a way of biting you in the ass. Clearly, a properly designed code line: BCF TRISB, OW_PIN ; Will actually WORK in either PIC. Use comments to explain what "OW_PORT" does for you, and stick with the Microchip definitions of the registers. (It makes the code MUCH clearer for debugging.) Take what you like, listen to the rest... Tom >OW_SetLoDone: > return > >The idea was that if I changed port/pin later, I would not have to change >multiple definitions. But with the 18F, the PORT and TRIS values were not in >the same offset in different banks (as with the 16F), so simply removing the >bank-selection statements changed the meaning of everything. > >Cheers, >-Neil. > > > >On Wednesday 20 July 2005 02:02 am, Roland scribbled: > > >>Hi >> >>I spent awhile battling with the conversion to 18F. Below is some code to >>read a block of onboard EE into ram. I'm not going to format the text, but >>it does work fine. Hopefully it's of help. >> >>Regards >>Roland >> >> > > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist