Check your manual about DCD, logical and bitwise operators. It's all thereI don't understand : TRISB = ((DCD i) << (ADCChannel*3)) ^255
Anyone wants to explain it?
Yes I've put some black magic in![]()
Check your manual about DCD, logical and bitwise operators. It's all thereI don't understand : TRISB = ((DCD i) << (ADCChannel*3)) ^255
Anyone wants to explain it?
Yes I've put some black magic in![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hello Steve ,
i have some erratic values on BTN result ( BTN = TRISB ) under pic smulator ide 6.91 .
like 1 . 2 . 4 .255 and cycle infinite .
But i will try this evening on led test or resistors.
I note in 16f877x datasheet that with "1" TRISB , we have High Impedance so we can choose whose resistor to be put off .
But with other state bit of TRISB , i don't understand how tie to common +5V of car radio (TIP) to the RB0,RB1,RBx..... ???
We have agree that it is a result of a resistor between common ground (sleeve) and +5V (tip) on jack "grip" .
Hervé.
Never trust a sim... as simple as that. They're on the market for laziness and to make good money out of it. Good enough to replace any xBox, Nintendo... or some porn.
You tie the resistor like the guy in that previous thread. One side on the PIC the other side are tied together and sent to the Radio.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Steeve,
i test intensity value with some résistors tie together to one led.
But with your program , trisb stay at 255 , i put some select case for test but no trisbx.0 work (255 always)
I will try to my test platine .
I understand your "voodoo formule" , it is for have only one button put on , no action with 2,3 .. together .
Regards.
Hervé
i repeat my question :
how tie the resistors on the side of PIC together to have a resultant resistor in parallele ?
i agree that the other side is tie together to the radio , but on the ground ,yes
but the +5V for PIC RBx ?
Regards.
Hervé
in fact , the simulator isn't reactif with adc , i must go slowly with an0/an1 choice .
But step by step around button(i) , it works.
I must add six other buttons in programm and .
Can i use btn as word variable for a select case like 1110111111111111 ?
(with your formule dcd(i).... )
i can't for the moment ...
i use adcchannel 0 to 3 .
Regards.
Hervé
Bookmarks