Society of Robots - Robot Forum

Software => Software => Topic started by: mahmosha on September 16, 2011, 03:51:35 PM

Title: pic16f877a
Post by: mahmosha on September 16, 2011, 03:51:35 PM
how to read analog inputs for the photoresistor etc? need help plz
Title: Re: pic16f877a
Post by: waltr on September 16, 2011, 09:24:18 PM
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.
Title: Re: pic16f877a
Post by: mahmosha on September 17, 2011, 02:28:12 AM
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
Title: Re: pic16f877a
Post by: waltr on September 17, 2011, 12:13:40 PM
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.