Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why this code is not transmitting array?

Status
Not open for further replies.
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:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top