That osccon looks pretty dodgy
That osccon looks pretty dodgy
Warning I'm not a teacher
Well it runs, and runs on 16mhz, I judge this by issuing HPWM 2,127,1000 statement, and measuring output frequency
If I leave OSCCON same and set DEFINE OSC to 32mhz, then it outputs 500hz.
Changed: OSCCON=%01111011
Now LCD works on 16mhz, but still misbehaves sometimes - displayed characters get distorted, say you send text "TEST TEXT" and some letters will be replaced with garbage from user character area. I tried adding filtering capacitors/etc - no luck.
You don't want filtering caps on communications lines, you want the high-low-high transitions as crisp as possible. If anything, you may adjust the SLRCONx settings.
LOL I'm not adding filtering caps to data lines. I'm adding them to power lines![]()
Looking at the library code, if the clock is set for > 16MHz (or 24MHz in some cases) it uses a longer internal delay before asserting some of the control pins.
Try this - lie to the compiler and tell it you're running faster than you really are:
DEFINE OSC 32 'set oscillator speed
Don't change your OSCCON setting... leave it so you're still actually running at 16MHz.
Bookmarks