Dec 3, 2012 #1 I internetuser2k12 Banned Joined Jul 25, 2012 Messages 1,192 Helped 171 Reputation 342 Reaction score 162 Trophy points 1,343 Activity points 0 Why this code is not transmitting array to UART? Only the first element is being transmitted. Row should be given 0 and column 16. Code: void UART_Write_2DArray(char TwoDArray[10][16], unsigned int _row, unsigned int _col) { for(i=0;i<=_col;i++) { TwoDArray[_row][i] = 'X'; TXREG = TwoDArray[_row][i]; while(!TXIF); PIR1.TXIF = 0; PIE1.TXIE = 1; } } OK. The problem got solved. Here is the new working code. Code: void UART_Write_2DArray(char TwoDArray[10][16], unsigned int _row, unsigned int _col) { for(i=0;i<=_col;i++) { TwoDArray[_row][i] = 'X'; TXREG = TwoDArray[_row][i]; [COLOR="#0000FF"]while(!PIR1.TXIF);[/COLOR] PIR1.TXIF = 0; PIE1.TXIE = 1; } } Last edited: Dec 4, 2012
Why this code is not transmitting array to UART? Only the first element is being transmitted. Row should be given 0 and column 16. Code: void UART_Write_2DArray(char TwoDArray[10][16], unsigned int _row, unsigned int _col) { for(i=0;i<=_col;i++) { TwoDArray[_row][i] = 'X'; TXREG = TwoDArray[_row][i]; while(!TXIF); PIR1.TXIF = 0; PIE1.TXIE = 1; } } OK. The problem got solved. Here is the new working code. Code: void UART_Write_2DArray(char TwoDArray[10][16], unsigned int _row, unsigned int _col) { for(i=0;i<=_col;i++) { TwoDArray[_row][i] = 'X'; TXREG = TwoDArray[_row][i]; [COLOR="#0000FF"]while(!PIR1.TXIF);[/COLOR] PIR1.TXIF = 0; PIE1.TXIE = 1; } }