Content originally posted in LPCWare by rocketdawg on Tue Jun 09 14:09:01 MST 2015
Cannot say what the problem is, but do not call printf() in the ISR.
Printf is a big function and it takes a lot of time to execute.
void send(char *txbuf){
char echo_off[] = "ATE0\r";
char line1[]="AT\r";
char linex[] ="AT+IPR=9600\r";
this must be a school project where they tell you that global variables are BAD.
every time you call this function, those strings are created. Every time the function exits, those strings are destroyed.
Big waste of CPU resources, maybe the compiler optimizer is smart enough to do something about them, but I doubt it.
use the keyword "static" or make them global.
your delay function will not work with a optimized build. It might not even work in a debug build. The compiler might just throw away the code since it does nothing. Why not use SysTick for a delay?
the login in the ISR is hard to follow, I'm bailing out