P2: pin output question
potatohead
Posts: 10,261
Here is a short program that writes the counter to some of the output pins with LED's attached on the DE2 board. Edited because I pasted the wrong code. Sorry. Here are the correct programs:
What am I missing here? No combination of AND appeared to work for me. ??? I tried making the outmask value all ones too.
' Terasic DE2-115 Prop2 LED Blinker ' ------------------------------------ ' This one is broken, and I don't know why DAT org neg dirb, #1 'make the port B I/Os outputs :loop getcnt A 'fetch lower 32 bits of global counter shr A, #16 'shift away the fast incrementing digits and A, outmask 'zero lower bits mov pinb, A 'write slow ones to LED's on DE2 board jmp #:loop 'keep doing it! A res 1 'storage B res 1 outmask long $00_00_FF_00 'write higher bits only ' Terasic DE2-115 Prop2 LED Blinker ' ------------------------------------ ' This one works! DAT org neg dirb, #1 'make the port B I/Os outputs :loop getcnt A 'fetch lower 32 bits of global counter shr A, #24 'shift away the fast incrementing digits shl A, #8 mov pinb, A 'write slow ones to LED's on DE2 board jmp #:loop 'keep doing it! A res 1 'storage
What am I missing here? No combination of AND appeared to work for me. ??? I tried making the outmask value all ones too.
Comments
Why not use this that way