- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can anyone help me explain why if I perform fprintf(s, '%s','103') in Matlab, and for Nios II char heatOutput[128]; while( !( uart_status & ALTERA_AVALON_UART_STATUS_RRDY_MSK ) ) { uart_status = IORD_ALTERA_AVALON_UART_STATUS(UART1_BASE); } if( (uart_status & ALTERA_AVALON_UART_STATUS_RRDY_MSK) != 0) { printf("heatOutput: "); for(x=0;x<128;x++) { while( !( uart_status & ALTERA_AVALON_UART_STATUS_RRDY_MSK ) ) { uart_status = IORD_ALTERA_AVALON_UART_STATUS(UART1_BASE); } heatOutput[x] = IORD_ALTERA_AVALON_UART_RXDATA(UART1_BASE) ; // Read character printf("%c", heatOutput[x]); } } all I get from my printf is the last character in the send string: heatOutput: 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 (instead of heatOutput: 103) How ever long the string I sent from Matlab (or even with %c or %i), printf only shows the last character. Help please. Thank you.Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page