Working with reservations
Hi,
Got that 10F ZIF adapter. I had also thrown together an ICSP setup on my breadboard. Both work! Iʻd rather use the ZIF, and free up the breadboard!
SO, after getting a good test running, I put together my first draft program and got ʻUnable to fit Variableʻ error. Nice. Turns out that PBP uses 22 bytes of RAM for storing data that it uses to run my code. Well, the 10F222 has 23 bytes of RAM... I got 1 byte variable to use in my PBP program! This is a rude awakening.
The essence of my project is to fade 3 LEDs. Not much heavy lifting going on here. I started incorporating the TMR0 in my software PWM loop. That worked barely. The basic structure of my PWM loop is:
FOR X = 0 TO 100
FOR Y = 0 TO 100
IF Y < X THEN
GPIO = 1
ELSE
GPIO = 0
ENDIF
NEXT Y
NEXT X
to fade the other way, you just mirror the above loop.
You see that Iʻm using 2 byte variables here...
So what Iʻve done is to commandeer the OSCCAL register. There is an issue with bit 0 of OSCCAL and that it effects GP2. I just increment OSCCAL by 2 when Iʻm using it. I got some usable LED fading happening and found a free variable! :cool:
Iʻm still not happy though. I really need one more byte var to get the effect that I want. Anybody have any ideas? Is it possible to tap into the RAM area that PBP uses? Maybe thereʻs a DEFINE somewhere that I can make do my bidding...?
Iʻll post the code soon. Itʻs on another machine
Joel