the pot values goes from 127 to 0 instead 0 to 127?
then change the plus and minus on your pot, that changes the direction
the pot values goes from 127 to 0 instead 0 to 127?
then change the plus and minus on your pot, that changes the direction
i know it's only microcontrolling, but i like it!
The pot starts from $7f, decreases till 0 and goes to $7f in the same direction!
But i used advar = advar >> 1 instead of >> 2, because the second starts from $3f to 0 to $3F!
Why?
I'm also into MIDI. I've made a midi sender with the 18F452 and was wondering about the 12F683. But since it didn't have HSEROUT I wasn't sure if it would work. So it seems it can work with serout using a 20 Mhtz xtal?
Something I'm confused about however is the setting up of the ANSEL.
I see that in the example above by Ingvar there are 2 bits that are set high along with the appropriate pins: like this ANSEL %00110011, but in Allaskan's example he just does this: ANSEL %00000011
So GPIO.0 and GPIO.1 are analog inputs, but what do the 1's in position 4 and 5 represent?
What is the ADCON0 doing?
Also, why do you have to disable the analog comparators?
Thank,
Tony
Last edited by TonyA; - 14th April 2006 at 00:08.
HI Tony,
i used to send midi messages with the serout2 command at 31250 only with 16 and 20 mhz xtals and it works!
If you look at the datasheet of the 16f675 everything is revealed to you!
I think that ANSEL %00110011 sets the ad conversion clock to FRC and gp0 gp1 to ad inputs.
ADCON0 is the A/D CONTROL REGISTER, you use it if you want to set the conversion less automated.
I disable the comparators only for precaution!
bye
Hi,
I was interested in your use of the 12Fxxx chip, and I noticed you used the DEBUG to send the midi messages out. Does the DEBUG work better than the serout2 for the 12Fxxx chip? (I'm interested in using the 12F683, I think you mentoned you used the 12F675?
Thanks again,
Tony
You are right,i mentioned the 12f675.I think there isn't much differences between the serout2 and the debug command,but my programming skill is low, i used both to send midi messages and they work ok!
Bookmarks