Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Why this code is not transmitting array?

Status
Not open for further replies.
Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top