Society of Robots - Robot Forum
Software => Software => Topic started by: mahmosha on September 16, 2011, 03:51:35 PM
-
how to read analog inputs for the photoresistor etc? need help plz
-
It in the data sheet and also in this tutorial:
http://www.gooligum.com.au/tutorials.html (http://www.gooligum.com.au/tutorials.html)
Look in the "Midrange PIC Architecture and Assembly Language" lessons for ADC (Lesson #13).
One great thing about PICs is that they all work very much the same way. That means the code and lesson on a 16F627 will work on a 16F877 with minor changes. Just be sure to compare the data sheets on the two PICs to find what needs changing.
-
It in the data sheet and also in this tutorial:
http://www.gooligum.com.au/tutorials.html (http://www.gooligum.com.au/tutorials.html)
Look in the "Midrange PIC Architecture and Assembly Language" lessons for ADC (Lesson #13).
One great thing about PICs is that they all work very much the same way. That means the code and lesson on a 16F627 will work on a 16F877 with minor changes. Just be sure to compare the data sheets on the two PICs to find what needs changing.
hey thx for the link but the stupied thing is i use mikroc not assamply :S
-
hey thx for the link but the stupied thing is i use mikroc not assamply :S
[/quote]
So what. The data sheet has the definitions of the assembler instructions so it is not that difficult to see what they do then write your code with Mikroc. In PICs the register set up is almost exactly the same whether you use assembler or C. Example:
; assembler
movlw 0x80
movwf PORTB ; set pins on port B, RB7 - 1, RB6-0 = 0
// C
PORTB = 0x80;
If you really looked you would have seen that the tutorials are also in C.