counters / an001
agfa
Posts: 295
re: nco/pwm sample code the line
crta := %00100_000 << 23 + 1 << 9·+ 0
sets bit9, the bpin lsb, if i understand.· why is that?
also is there more counter documentation?
edit:
i see no difference on the output if i remove "+ 1 << 9 +0" from the line
Post Edited (agfa) : 8/10/2008 2:46:02 PM GMT
crta := %00100_000 << 23 + 1 << 9·+ 0
sets bit9, the bpin lsb, if i understand.· why is that?
also is there more counter documentation?
edit:
i see no difference on the output if i remove "+ 1 << 9 +0" from the line
Post Edited (agfa) : 8/10/2008 2:46:02 PM GMT
Comments
then the 1 << 9 would indicate a complementary output on BPIN which, in this case, would be pin 1.
So the reason deleting + 1 << 9 + 0 didn't change anything is twofold:
1) the 1 << 9 was ignored to begin with, and
2) deleting 0 doesn't change the value of the expression. APIN is still 0.
The example contains yet further misdirection in the _000 part of %00100_000. In the PLL modes, these three bits indicate the value of the clock division. In NCO modes, they have no effect whatsoever and can take any value. My preference would be to express it %00100 << 26 instead, which removes any implied significance from the "PLL" bits.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
Post Edited (Phil Pilgrim (PhiPi)) : 8/10/2008 4:42:52 PM GMT
edit:
ok, i tried it, thats what it appears to do.· i was unable to get that from the note.
thanks phil
Post Edited (agfa) : 8/10/2008 7:42:09 PM GMT
according to the table 2 on pg 3, the output is PLLx.· figure 5 on page 9 indicates input as "clock in".· is the input the system clock, or pin 31 of PHSA, or what?· how does the FRQA come in to play?
by playing around with it i see that FRQA does effect it, but i can't predict what it's doing.
edit:· on a second look i see that there is a phase compare in the figure.· i would still like some insight.
Post Edited (agfa) : 8/11/2008 12:27:52 PM GMT
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
thanks again.