Hi forum,
Im trying to develop an embeded code with mbed. I want to use the serial port to send and receice string. I have no probleme sending via uart but when it comes to receiving i cant do it. First what happen is i use an arduino serial.write function to send a continue hello world string in order to test. when i connect the arduino to the chip max32630fthr it reset in loop and i cant read the string. I use the Serial Uart(tx,rx) where tx is P3_1 and rx is P3_0. I use the attach function. for exemple my code is something like this simplified.
volatile char c = ‘\0’;
void charReceive(void){
c = Uart.getc();
}
int main(){
Uart.baud(9600);
Uart.attach(&charReceive);
while(1){
debug.printf(“%c”, c);
}
}
what happen is the code run no probleme its when i plug the uart that everything just crash.
Well, ive found the source of the crash not its now crashing anymore but i still cant receive any uart data. any idea? im still using the same code as in the first post
I actually already use the uart1 for the standard debug print, but there is not any more print somewhere for crash report. i use another uart port, uart2 for my project.
For the crash, i just commented some intterupt initialisation of the max30001 chip but i havent yet investigated further.
I still cant receive any uart data from my first code and with your code. I just tried to do the simple blocking code
while(1){
debug.putc(uart.getc());}
what happened is when i connect the uart form the arduino to the max32630fthr, i get 1 or 2 character and then nothing after. if i unplug the uart it crashed and reset.
thats what i get so far, the led which is supposed to be ON, start blinking when uart is connected which i guess is not normal.
You were absolutely right about the arduino outputting 5v and the max taking 3.3v. i used a voltage divider and now its working well!! thank you very much!