Re: Strange Behavior 12F1822

Originally Posted by
nobner
Hi Henrik,
thank you for your great help, writing the LAT register did the job. Signals are perfect now.
I also found now a second solution for the problem - using the "high porta.0" and "low porta.0" works also.
Thank you very much,
best regards
Norbert
Norbert,
So, your code is working as expected without having DEFINE OSC X in your code block?
If you are using 32MHz or 16 MHz or 8Mhz you need to tell the compiler at what speed it is running.
Otherwise, it will compile for 4Mhz.
For High and Low commands, it may not reflect the difference;
But, if you are using PWM commands especially something like MIBAM, there will be serious difference.
For example, if you set your OSCCON register to 8Mhz and enable PLL (that gives 32Mhz), as you did, but do not have DEFINE OSC 32 , the chip will run at 32Mhz, but the compiler will compile your code for 4Mhz as default.
If I am wrong with anything with my sayings here, someone please correct me.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks