Alloy
Advanced Member level 4
Hey
I tried to send UART commands from Arduino to PIC18F4620.
It did not work at any baud rates, pic received garbage, only 'x' characters.
But then I realized that my PIC is using HS oscillator with 4X PLL.
And I tried this code:
and on pic:
and it received "A", 'a', and some garbage, but works way better than my other ideas.
What's wrong?
I tried to send UART commands from Arduino to PIC18F4620.
It did not work at any baud rates, pic received garbage, only 'x' characters.
But then I realized that my PIC is using HS oscillator with 4X PLL.
And I tried this code:
Code:
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(2400);
}
// the loop routine runs over and over again forever:
void loop() {
Serial.println("Aaa");
delay(100); // delay in between reads for stability
}
Code:
UART1_Init(600);
while(1)
{
if (1 && UART1_Data_Ready() == 1) {
/// UART_Read_Text(tmp, "\n", 64) ;
tmp[0] = UART1_Read();
tmp[1] = 0;
My_Print(tmp);
}
and it received "A", 'a', and some garbage, but works way better than my other ideas.
What's wrong?