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.

Change code from C to picbasic

Status
Not open for further replies.

savnik

Junior Member level 2
Joined
Apr 23, 2003
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
121
Code:
int setFreq[] = {1,0,1,1,1,1,1,1,1,1,0,1,0,0,1,0};
// set the frequency to 102.1 MHz and other config bits for audio IC
// write_to_chip - write enable, clock, and data bits to audio IC
void write_to_chip(){
int i,j;
PBOUT |= 0x01;
for(j = 0; j <= 10; j++) // set a clock delay
asm("nop");
for(i = 0; i < 16; i++){
if(setFreq[i] == 1)
PBOUT |= 0x04; // set data bit
else PBOUT &= 0xFB;
for(j = 0; j <= 10; j++) // set clock down delay
asm("nop");
PBOUT |= 0x02; // turn clock on
for(j = 0; j <= 10; j++) // set up clock delay
asm("nop");
PBOUT &= 0xFD; // turn clock off
}
PBOUT &= 0xFE;
}
How to change this code to picbasic pro
I use 16f88
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top