And... it was easier to hack than i thought....
OR for less code generated solutionCode:Sel2: if swcount = 1 then READ ((Patt1>>0)+counts), PORTB ;read the next value in patt1 and display it on PORTB if swcount = 2 then READ ((Patt2>>0)+counts), PORTB if swcount = 3 then READ ((Patt3>>0)+counts), PORTB if swcount = 4 then READ ((Patt4>>0)+counts), PORTB if swcount = 5 then READ ((Patt5>>0)+counts), PORTB if swcount = 6 then READ ((Patt6>>0)+counts), PORTB if swcount = 7 then READ ((Patt7>>0)+counts), PORTB RETURN
Enjoy!Code:Sel2: if swcount = 1 then READ ((Patt1+0)+counts), PORTB ;read the next value in patt1 and display it on PORTB if swcount = 2 then READ ((Patt2+0)+counts), PORTB if swcount = 3 then READ ((Patt3+0)+counts), PORTB if swcount = 4 then READ ((Patt4+0)+counts), PORTB if swcount = 5 then READ ((Patt5+0)+counts), PORTB if swcount = 6 then READ ((Patt6+0)+counts), PORTB if swcount = 7 then READ ((Patt7+0)+counts), PORTB RETURN
For sure there's way to reduce the code size but i leave this in your hand
teaser
Select case is another one, LOOKUP too.Code:Addr=Patt7+counts Read addr, PORTB
And you can configure PORTB as digital in your config fuses with the right setting
OR useCode:_PBADEN_OFF_3H ; PORTB<4:0> pins are configured as digital I/O on Reset _PBADEN_ON_3H ; PORTB<4:0> pins are configured as analog input channels on Reset
ADCON1=$0F
CMCON=7





Bookmarks