View previous topic :: View next topic |
Author |
Message |
Futterama
Joined: 17 Oct 2005 Posts: 98
|
Writing non-existing register, can I do that? |
Posted: Mon Mar 17, 2008 7:30 am |
|
|
Hi,
I'm using a mix of PIC10F202 and PIC10F206. The difference between the 2 is that PIC10F206 has a comparator, and PIC10F202 doesn't.
I'm not using the comparator so in my PIC10F206 code I disable it. Can I somehow use the PIC10F206 code for the PIC10F202 too? Would it matter to write to a register not implemented in the PIC?
I was thinking of reading the register bit, and if it was set, then clear it. The bit is set at reset and powerup and I guess it would read as 0 on the chip where the register is not implemented (PIC10F202) ?
Hope you can help.
Regards,
Futterama |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Mon Mar 17, 2008 7:50 am |
|
|
Start by looking at the chips data sheet.
Look at Table 4-1.
Look in particular at Note5.
Except for this, there is no reason not to use the same code. If you ae not using this ability, no problem.
Then look at Figures 4-3, and 4-4. Note2.
The main control register, will simply read as '0' on the 202.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Futterama
Joined: 17 Oct 2005 Posts: 98
|
|
Posted: Mon Mar 17, 2008 8:22 am |
|
|
Ttelmah, thanks, I wasn't able to find that information in the datasheet, but I guess I didn't look hard enough ![Rolling Eyes](images/smiles/icon_rolleyes.gif) |
|
![](templates/subSilver/images/spacer.gif) |
Franck26
Joined: 29 Dec 2007 Posts: 122 Location: Ireland
|
|
Posted: Mon Mar 17, 2008 2:06 pm |
|
|
And what about something like:
Code: | #if device == PIC10F206
// code to write into the register
#endif |
Franck. |
|
![](templates/subSilver/images/spacer.gif) |
Futterama
Joined: 17 Oct 2005 Posts: 98
|
|
Posted: Mon Mar 17, 2008 2:09 pm |
|
|
Franck26 wrote: | And what about something like:
Code: | #if device == PIC10F206
// code to write into the register
#endif |
Franck. |
Well, that will be run at compile time - I want to use the same .hex file for both devices. |
|
![](templates/subSilver/images/spacer.gif) |
|