Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
int SBR,SBW,SBC; //Serial buffer pointers
//Read , Write ,Current
int SerialBuf_size = 20 ;
char RX_FIFO[21] ; // U2RX character FIFO buffer
int HC12_input=0;
char pro_buffer() // called if HC12_input
{
char serial_in;
serial_in = RX_FIFO[SBR];
SBC++;
SBR++;
SBR %= SerialBuf_size;
SBC %= SerialBuf_size;
HC12_input = 0;
return serial_in ;
}
void __attribute__((__interrupt__, auto_psv))_U2RXInterrupt(void)
{
while(U2STAbits.URXDA) // data available
{
RX_FIFO[SBW] = U2RXREG ;
if ((SBW+1)% SerialBuf_size != SBR)
{
SBW++;
SBW %= SerialBuf_size;
}
}
IFS1bits.U2RXIF = 0;
HC12_input = 1; // flag SERIAL DATA IN
}
I'm going to have to oder some of the newer chips I'm playing with a 16f876a I found in the dumpster at work it came from a heater pid controller so I figured I mess around with it and xc8 blink worked good Adc is what I'm going to send just something to do for a crazy old man lol