I need all of your help to write a code to make PIC communicate with bitstream data.
bitstream data at 256kbaud is input in PIC, then it is stored in PIC memory, finally the data is transmit in another port of pic. And among them, a 512khz clock is used to record the bitstream.
But now the code doesn’t work. So can you help me to find the error?
Any information is appreciated.
#include <16F877.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#use delay(clock=20000000)
#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7, parity=N, bits=8, stream=TXBEE)
void main()
{
int eeg[20];
int i;
while(TRUE)
{
for (i=1;i<21;i++)
{
while (input(PIN_C0)==0) {}
eeg*=input(PIN_C1);*
while (input(PIN_C0)==1) {}
}
for (i=1;i<21;i++)
{
output_bit(PIN_C2,eeg);
}
}
}