Shop OBEX P1 Docs P2 Docs Learn Events
Shifting registers — Parallax Forums

Shifting registers

I'm trying to understand the register shifting used in counter examples.
Shifts.jpg
''Demonstration of NCO counter mode (%00100)
CON
 _clkmode = xtal1 + pll16x
 _xinfreq = 5_000_000
PUB NCO_single_ended_mode
' mode PLL BPIN APIN
 ctra := %00100_000 << 23 + 1 << 9 + 0 'Establish mode and APIN (BPIN is ignored)
 frqa := $8000_0000 'Set FRQA so PHSA[31] toggles every clock
 dira[0] := 1 'Set APIN to output
 repeat 'infinite loop, so counter continues to run

What is the
<< 9 + 0
about? If there is any more sifting of the registrar then the CTRMODE would not line up.
If I wanted to designate PIN 5 as APIN, and PIN 12 as BPIN, what would the shift command look like?

Side note. I wish the preview for this discussion would work so that knew how it will look before submitting.
2237 x 265 - 249K

Comments

Sign In or Register to comment.