--_004_016f01cb4f51a20c20000300a8c0main_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ivp wrote: > One thing I notice is that stepping through the unlock sequence does > not change OSCCON in the Watch Window. Maybe OSCCON > doesn't work in Watch as other SFRs do You can't single step thru the unlock sequence, at least not with a in-circuit debugger since there are always processor cycles between steps o= f your code. It may work in the simulator and the ICE, but I don't think any of the 33F are supported with the ICE. Because manually writing the pin select code for each pin is too easy to mess up, I have a macro that helps with that. The attached A.DSPIC file shows this macro, the relevant lines from a example that calls it, and the resulting bare ASM30 instructions. The macro will look strange unless you're familiar with my preprocessor, bu= t it's probably not that hard to see what it's doing, and you can always look at the bare ASM30 instructions to see what all the preprocessor gobbledygoo= k resulted in. The file B.DSPIC is the snippet of code that disables the pin select after all the individual modules have already done their pin mappings. I don't know if this will help, but hopefully you can see something I'm doing differently than you are. --_004_016f01cb4f51a20c20000300a8c0main_ Content-Type: application/octet-stream; name="a.dspic" Content-Description: a.dspic Content-Disposition: attachment; filename="a.dspic"; size=1737; creation-date="Wed, 08 Sep 2010 05:39:42 GMT"; modification-date="Wed, 08 Sep 2010 05:39:42 GMT" Content-Transfer-Encoding: base64 OyoqKioqKioqKioqKioqKioqKioqDQo7DQo7ICAgTWFjcm8gU0VMRUNUX09VVFBJTiBuLCBpZA0K Ow0KOyAgIENvbmZpZ3VyZSB0aGUgUlBuIHBpbiB0byB0aGUgcGVyaXBoZXJhbCBvdXRwdXQgaWRl bnRpZmllZCBieSBJRC4gIE4gbXVzdCBiZQ0KOyAgIHRoZSAwLTE1IHJlbWFwcGFibGUgcGluIG51 bWJlciwgYW5kIElEIG11c3QgYmUgdGhlIDUgYml0IElEIG9mIHRoZSBwZXJwaGVyYWwNCjsgICBv dXRwdXQgdG8gbWFwIHRvIHRoYXQgcGluLiAgT25seSB0aGUgc2VsZWN0aW9uIGZvciB0aGUgaW5k aWNhdGVkIHBpbiBpcw0KOyAgIGNoYW5nZWQuICBPdGhlciBzZWxlY3R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LS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tDQoNCg0KOyAgIEhlcmUgaXMgZXhhbXBsZSBjb2RlIGNhbGxp bmcgdGhpcyBtYWNybzoNCg0KL2NvbnN0ICAgdHhwaW4gICBpbnRlZ2VyID0gMyA7UlBuIG1hcHBh YmxlIHBpbiBudW1iZXIgb2YgdHJhbnNtaXQgbGluZQ0KICAgICAgICAgc2VsZWN0X291dHBpbiBb diB0eHBpbl0sIDBiMDAwMTEgO3NldCBUWCBwaW4gc2VsZWN0aW9uDQoNCg0KDQotLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tDQoNCg0KOyAgIEhlcmUgaXMgdGhlIGJhcmUgQVNNMzAgY29kZSB0aGUgcHJlcHJvY2Vz c29yIHByb2R1Y2VkOg0KDQogICAgICAgICBtb3YgICAgICNScG9yMSsxLCB3MSA7cG9pbnQgVzEg dG8gYnl0ZSB0byBtb2RpZnkNCiAgICAgICAgIG1vdiAgICAgIzBiMDAwMTEsIHcwIDtnZXQgcGVy aXBoZXJhbCBJRA0KICAgICAgICAgbW92LmIgICB3MCwgW3cxXSA7c2VsZWN0IG91dHB1dCBwZXJp cGhlcmFsIGZvciBSUDMgcGluDQo= --_004_016f01cb4f51a20c20000300a8c0main_ Content-Type: application/octet-stream; name="b.dspic" Content-Description: b.dspic Content-Disposition: attachment; filename="b.dspic"; size=741; creation-date="Wed, 08 Sep 2010 05:39:42 GMT"; modification-date="Wed, 08 Sep 2010 05:39:42 GMT" Content-Transfer-Encoding: base64 Ow0KOyAgIExvY2sgdGhlIGN1cnJlbnQgcGVyaXBoZXJhbCBwaW4gc2VsZWN0aW9ucy4gIFRoZSBy ZW1hcHBhYmxlIHBlcmlwaGVyYWwgcGluDQo7ICAgc2VsZWN0aW9ucywgaWYgYW55LCB3ZXJlIG1h ZGUgYnkgdGhlIElOSVQgcm91dGluZXMgb2YgdGhlIGluZGl2aWR1YWwNCjsgICBtb2R1bGVzLg0K Ow0KICAgICAgICAgbW92ICAgICAjT3NjY29uLCB3MSA7cG9pbnQgVzEgdG8gT1NDQ09OIGxvdyBi eXRlDQogICAgICAgICBtb3YuYiAgIFt3MV0sIHcwICAgIDtnZXQgZXhpc3RpbmcgdmFsdWUNCiAg ICAgICAgIGJzZXQgICAgdzAsICNJb2xvY2sgO3NldCBiaXQgdG8gbG9jayBwZXJpcGhlcmFsIHBp biBzZWxlY3Rpb24NCiAgICAgICAgIG1vdiAgICAgIzB4NDYsIHcyICAgO2dldCB1bmxvY2sgdmFs dWVzIHJlYWR5IGluIFcyLCBXMw0KICAgICAgICAgbW92ICAgICAjMHg1NywgdzMNCiAgICAgICAg IGRpc2kgICAgIzMgICAgICAgICAgO09TQ0NPTiB1bmxvY2sgc2VxdWVuY2UgbXVzdCBub3QgYmUg aW50ZXJydXB0ZWQNCiAgICAgICAgIG1vdi5iICAgdzIsIFt3MV0gICAgO3VubG9jayBPU0NDT04g bG93IGJ5dGUNCiAgICAgICAgIG1vdi5iICAgdzMsIFt3MV0NCiAgICAgICAgIG1vdi5iICAgdzAs IFt3MV0gICAgO3dyaXRlIGRlc2lyZWQgdmFsdWUgdG8gT1NDQ09OIGxvdyBieXRlDQo= --_004_016f01cb4f51a20c20000300a8c0main_ Content-Type: text/plain; name="ATT00001.txt" Content-Description: ATT00001.txt Content-Disposition: attachment; filename="ATT00001.txt"; size=208; creation-date="Wed, 08 Sep 2010 05:39:42 GMT"; modification-date="Wed, 08 Sep 2010 05:39:42 GMT" Content-Transfer-Encoding: base64 LS0gDQpodHRwOi8vd3d3LnBpY2xpc3QuY29tIFBJQy9TWCBGQVEgJiBsaXN0IGFyY2hpdmUNClZp ZXcvY2hhbmdlIHlvdXIgbWVtYmVyc2hpcCBvcHRpb25zIGF0DQpodHRwOi8vbWFpbG1hbi5taXQu ZWR1L21haWxtYW4vbGlzdGluZm8vcGljbGlzdA0K --_004_016f01cb4f51a20c20000300a8c0main_-- .