pins question
bambino69
Posts: 126
in Propeller 2
DAT entry org 0 base rdlong base, ptra++ reg1 rdlong reg1, ptra++ buts rdlong buts, ptra++ led1 rdlong led1, ptra++ dirh led1 drvl led1 setq #3 wrpin ##%010_00_00000_0,#12 '15k pulldown setq #3 drvl #12 loop testp #12 wc if_c drvh #led1 jmp #loop retCan anyone see where this code is failing?
Comments
There's no clear answer as there's too many unknowns about the inputs, your intent and wiring of the LEDs. There's lots of undefined values there. What appears to be failing for you?
The push button does not work. Based on what I've read it should.
The led does, if directly driven. But detection of the button(to drive the led) is not recognized.
This lights every time with no button pushed
I need to find the instruction that clears the smart pin. It seems to keep its setting thru a reset
But, you can disable it with "DRVL". by setting DIR low on that pin
Interesting... That usage is not in the instruction spreadsheet, but it is mentioned in the "Design Status" section of the Docs (but nowhere else).
I think it is really not needed though, because you can include it into the next instruction and thereby save an instruction. Think you would just add a "3<<6" to the source terms...
If I was going to move this to a PASM2 cog, I would pass the base pin (so that I could move the board) and then do this:
@JonnyMac Hopefully I can look over this during the live event tonight. I may have to use pinclear() as I don't see a pasm equivalent.
I was using explicit pin #12 while debugging, It actually uses a basepin "buts". I took it out for the sake of the post.