Hein (fub) wrote,

  • Mood:

Hail to the king, baby!

It seems my most inspired time is in the morning, just before waking up completely. I tend to think up solutions for the problems I am faced with -- at least in the realm of programming and electronics. I had noticed that pin A4 did react to my settings, but pins A0-A3 didn't. So, I thought: I have 8 pins in port B that I can use, why not connect the ninth lead to A4?
And so I did that -- to little avail.

Dissapointed, I googled for 'porta pwm 16f628', and I saw that people set something in the CMCON-register, to turn off analog comparators. Intrigued, I opened up the datasheet and googled some more. The solution was simple: set the 7th bit in CMCON to turn off the analog comparators, and the pins will react like normal, well-behaved digital pins.

And now, I have 3 RGB-LEDs changing color via PWM. I'll clean up my code later and post it -- right now it's off to the showers and to bed!

  • Caching again

    With the weather vastly improving, it's time to go out geocaching again! A week ago, I came by the charming little town of Buren when I tried to…

  • Caching again

    Last Sunday, we went geocaching again. It was good to be outside and walk around for a bit. We've still got the caching skills, because we found…

  • Nightcaching, we're nightcaching

    Colleague J. and his girlfriend M., whom we have infected with the geocaching virus, have done a few nightcaches: geocaching multi's that can (only)…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded