Hello Everyone!
I have a project to receive a serial signal from a KENWOOD radio and plot this message in the display OLED.
The project it is simple. I receive de serial message via external interruption. Works fine.
The problem is: When I turn on the radio, imediately is send a serial signal message to plot the values in the display.
The first message I cant read because the Microcontroller dont start as fast like the radio send the message then the display don`t plot the message. The display stay without any data.
Someone knows what I can try to take this first message when the radio is on?
The microcontroller use the same VCC of radio. So, when turn on, microcontroller take the voltage in the same time.
I tried burn the hex program without bootloader, but don`t work.
Briefly, the loop waits for the external interrupt of the signal to receive the message and plot in the display using a u8g2 lib. I'm putting only the SETUP part and the message reading function. It works after boot but don`t work when turn on the radio.
ISR (INT0_vect) // INTERRUPTION - EDGE RISING
{
SerialDatal[i] = (PIND & (1 << PIND4));
i++;
//LendoDado = true;
} // FINAL
void setup() {
DDRD &= ~(1 << DDD2); // PORT2 WITH INPUT WITHOUT
PORTD = PORTD & ~ (1 << PD2);
DDRD &= ~(1 << DDD3); // PORT3 WITH INPUT
PORTD = PORTD & ~ (1 << PD3);
DDRD &= ~(1 << DDD4);
PORTD = PORTD & ~ (1 << PD4); // PORT4 WITH INPUT
EICRA |= (1 << ISC01) | (1 << ISC00); // EXTERNAL INTERRUPT
EICRA |= (1 << ISC10) | (1 << ISC11); // EXTERNAL INTERRUPT
EIMSK |= (1 << INT0); // EXTERNAL INTERRUPT
EIMSK |= (1 << INT1); // EXTERNAL INTERRUPT
sei();
u8g2.begin(); // START OLED SH1107 64X128 LIB
}
void loop() {
// WAITING THE INTERRUPT SIGNAL TO GET THE SERIALDATA AND PLOT....
}
Thanks all!
