Addpins - I don't understand
![pik33](https://forums.parallax.com/uploads/userpics/026/nFBJPVUJK5HCS.jpg)
I am experimenting with vga output. This works:
driver setxfrq ##$2BAF66BA debug(uhex(pa)) cogid pa 'insert cogid into dac modes setnib dacmode_s,pa,#2 setnib dacmode_c,pa,#2 rdlong av_base_pin,ptra[5] 'get av_base wrpin dacmode_s,av_base_pin drvh av_base_pin add av_base_pin,#1 wrpin dacmode_c,av_base_pin drvh av_base_pin add av_base_pin,#1 wrpin dacmode_c,av_base_pin drvh av_base_pin add av_base_pin,#1 wrpin dacmode_c,av_base_pin drvh av_base_pin add av_base_pin,#1 drvh av_base_pin
Now, instead of setting 3 pins pin by pin, I tried addpins
driver setxfrq ##$2BAF66BA debug(uhex(pa)) cogid pa 'insert cogid into dac modes setnib dacmode_s,pa,#2 setnib dacmode_c,pa,#2 rdlong av_base_pin,ptra[5] 'get av_base wrpin dacmode_s,av_base_pin drvh av_base_pin add av_base_pin,#1 wrpin dacmode_c,av_base_pin addpins 2 drvh av_base_pin addpins 2 add av_base_pin,#3 drvh av_base_pin
This doesn't work. Also the Propeller Plug red led is lit, the serial terminal goes mad (debug is disabled) and I cannot understand what I am doing wrong here. av_base_pin=8
Edit: after I removed all not necessary things from the code (posted below) the Propeller Plug doesn't go mad but the screen is still black if addpins used.
Comments
The full code simplified as much as I could. If it works, it displays green vertical strips. If addpins used, the screen is black.
Hehe, not hard to make that mistake. The
addpins
should be applied to the data contained atav_base_pin
. Ie:8 addpins 2
Oops... it applied addpins to the address and not to the value... Either more coffee or more rest needed.