Logical operators are not bitwise operators
| does a bitwise OR
OR does a Logical OR
2 | 3 = 7
2 OR 3 = ! 0 [ not nothing ]
Type: Posts; User: richard; Keyword(s):
Logical operators are not bitwise operators
| does a bitwise OR
OR does a Logical OR
2 | 3 = 7
2 OR 3 = ! 0 [ not nothing ]
.
NOT sure about that , this is what the book says
i_term=0
$e0 = binary 11100000
$f0 = bin 11110000
logical function AND (&) goes like this
a b a&b
0 0 0
0 1 0
1 0 0
1 1 1
TRISB = $f0|tmp the $f0 masks off the upper 4 bits [ this was to ensure other pins are not set to o/p by mistake
if you need to make portb.4 an output the
mask becomes $e0
TRISB = $e0|tmp ...
I probably could have phrased that better , the code does only support 12 leds . the idea was to get a feel about led brightness and flicker
to see if a 64 led version was worth the effort.
when...
yes the tris and port columns are binary 0b1100=0xC = 12 or pbp parlance %1100=$c=12
this is where i was heading for the led cube , current irq rate is 1000 Hz to drive 64 leds that needs to...
yes t and p are tris and port in decimal form for us humans
i can't run your code exactly my setup is wired differently to yours and different to my drawing too it appears
hence my...
led 11 failed cause i had a typo and did not convert from my setup to yours properly , sorry
'****************************************************************
'* Name : charlieplex.pbp ...
by using multiplexing you can " light' any or even all the leds its all about persistence of vision
to light them all
mainloop:
for led=0 to 11
lookup...
i see the problem
TRISA = %11110100 == bad
you can only light 1 led at a time , only two pins can be outputs at any one time (one high one low) the others need to be in a high impedence...
NOT ALL PICS ARE EQUAL , some study of the data sheet is always reccomended
your code is posted in Quote tags not code tags [#]
try this for a 16f84a
...
without a schematic its a bit difficult to intrepret whats going on in your code
wired like this , i made a table on whats needed to light each led
here is an example for a pic16f1825 to light...