Hey guys,
I've got a huge problem with passing arguments to an invoked function. It just doesn't work, at least sometimes... I can't figure out why this could possibly happen, but it does. My application is very small, just a few KB, thats why I dont assume there is a stack overflow or something like that. Any other guesses or maybe even solutions?
Thanks
The called funcition is this one':
void UART_vTransmitArrayASCII(ubyte *TxValue, ubyte TxByteCount) { ubyte idata i=0; for (i=0;i<TxByteCount;i++){ UART_vTransmitASCII(*(TxValue+i)); } } // uart_transmit
and the calling function is this one
void TIMERS_vISR(void) interrupt 1 using 1 { ubyte DataPtr[3]={12,12,33}; ubyte DataCount=3; // disable timer 0 interrupt ET0=0; UART_vTransmitArrayASCII(DataPtr,DataCount); // reinitialize TH0 = 0x63; TL0 = 0xC0; // enable timer 0 interrupt ET0=1; } // timers_isr0 The problem is, that the value of TxByteCount is not the one of DataCount, but something else.
Despite the dubious implied multi-byte UART transmission from a timer ISR, doesn't UART_vTransmitArrayASCII() need to know about 'using 1' too?
I'm sorry, I don't understand where your going with this 'using 1'.... Could you explain it in more detail?
"... where your going with this 'using 1'..."
You qualified your ISR with 'using 1'. I'm suggesting that since some function parameters are passed in registers within a register bank, doesn't the called function need to know which register bank to use? Could it not knowing be the problem?
Also, could the timer ISR be getting reentered while the UART transmit function is executing?
"Also, could the timer ISR be getting reentered while the UART transmit function is executing?"
Never mind that. I see that you're disabling the timer interrupt while transmitting.
View all questions in Keil forum