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.

converting code from PIC 16f84a to c8051f30

Status
Not open for further replies.

Narajin

Newbie level 2
Joined
Jan 11, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
Hi,

I wrote the following program for PIC16f84A which outputs 2 offset square wave pulses on pins B0 and B1 at 22hz. I'm using an external osc at 32khz on both cases. I need to migrate this code to C8051F300 chip. I'm not very familiar with it yet, so any help is welcome. I'm guessing just a slight modification (headers) and some pin initializations. Code is C. Thanks.


#include <16f84A.h>
#fuses XT,NOWDT,NOPROTECT
#use delay(clock=32000)


main() {

while (TRUE) {
OUTPUT_HIGH(PIN_B0);
OUTPUT_LOW(PIN_B1);
delay_us(22727);
OUTPUT_LOW(PIN_B0);
OUTPUT_HIGH(PIN_B1);
delay_us(22727);
}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top