I'm studying now microcontrollers , and i have to do a program in pic 16f84a in c(pcw ccs compiler). This program must add a bit from PORTA with 05h data and the result must show in PORTB. PORTB = PORTA + 05H.
SO this is the program i have done, it's compile without errors, but in the circuit it doens't works well. I don't know what are the errors, If someone could help me, i would greatly apreciate.
#include <16f84a.h>
#fuses xt, nowdt
#use delay(clock= 4000000)
#byte portb = 6
#byte porta = 5
int main(){
int w = 5 ;
set_tris_b(0x00);
set_tris_a(0x1F);
while(true){
w = porta + w;
portb = w;
}
}
This is the circuit i made
SO this is the program i have done, it's compile without errors, but in the circuit it doens't works well. I don't know what are the errors, If someone could help me, i would greatly apreciate.
#include <16f84a.h>
#fuses xt, nowdt
#use delay(clock= 4000000)
#byte portb = 6
#byte porta = 5
int main(){
int w = 5 ;
set_tris_b(0x00);
set_tris_a(0x1F);
while(true){
w = porta + w;
portb = w;
}
}
This is the circuit i made
Attachments
-
82.5 KB Views: 15