Author Topic: pic16f877a  (Read 2410 times)

0 Members and 2 Guests are viewing this topic.

Offline mahmoshaTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
pic16f877a
« on: September 16, 2011, 03:51:35 PM »
how to read analog inputs for the photoresistor etc? need help plz

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: pic16f877a
« Reply #1 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

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.

Offline mahmoshaTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Re: pic16f877a
« Reply #2 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

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

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: pic16f877a
« Reply #3 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.

 


data_list