Altera_Forum
Honored Contributor
8 years agoqsys_jtag_uart doubt
hi,
is it possible to print a series of number in nios 2 console using jtag uart along with nios2+onchip ram. i am implemented an counter and made it as a custom component in qsys and i am using it (adder+onchipram+nios 2+jtag uart). i tried it but it is printing 0. my c code::::: --- Quote Start --- /* * main.c * * created on: jun 6, 2017 * author: dipin */ #include "stdio.h" #include "io.h" #include "system.h" int main() { signed int ans; ans = iord(counter_interface_0_base,0); printf("%d",ans); while(1); return 0; } --- Quote End --- " COUNTER_INTERFACE_0_BASE" is the same in my system.h file my verilog code --- Quote Start --- module counter_jtag_check (clk,reset); input clk; input reset; jtag_count u0 ( .clk_clk (clk), // clk.clk .reset_reset_n (1'b1) // reset.reset_n ); endmodule --- Quote End --- update:: i am able to print only one number.. ( i am counting from 1 to 65556, but its only printing 52429) so is it possible to print all numbers ? can anybody please give any solutions??? --- Quote Start --- while(1) { ans = IORD(COUNTER_INTERFACE_0_BASE,0); printf("%d",ans); } --- Quote End --- i tride above c code also, but it is printing the same value again & again. my clock is 50mhz.
any help is really appriciated . thanks and regards