Narajin
Newbie level 2
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);
}
}
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);
}
}