Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help to write IR TX code in pic 12c508

Status
Not open for further replies.

paulsingam

Newbie level 5
Joined
Sep 7, 2010
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,342
I have written IR transmitter code for automatic railway gate.
how to write this code(written for 16f877A) for 12c508A.
kindly convert this code for 12c508A




set_tris_b();

while(1)
{
output_b(0x00);
delay_ms(13);
output_b(0xff);
delay_ms(13);

}
 

Just change the port names, the rest will work exactly as before. The 12C508A does not have a port B !

Also check the clock speed is the same or your timing will be wrong.

Brian.
 

Hi,
In 12C508, there is no TRISB or PORTB, it's TRISIO and GPIO.
So, you have:
Code:
TRISIO=0;
while(1)
{
   GPIO=0;
   delay_ms(13);
   GPIO=0xff;
   delay_ms(13);
}

Hope this helps.
Tahmid.
 

Thanks for the detail bro,... will surely check that,....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top