View Full Version : NMIX/T-0016 test.c
rcottrell
08-11-00, 04:46 PM
Trying to run the 'test.c' example program and having some problems...<p>Looking at the 'test.obj' file, the program as compiled with the 'test.bat' file will not be loaded at address 8000.<p>I loaded the program from a hyperterm as a text file. Is this correct?<p>When excuted (X 8000) the output seems to be a memory dump and it looks like watchdog kicks in and 'monitor' comes up.<p>Do you have a working example?<br>
nmitech
08-14-00, 11:20 AM
The COMMON51.C is default configuration for ROM memory map. If you want to load the object file to ram, U3 socket you must remap the COMMON51.C then re-compile the program again. Please read the APPNOTE01.TXT for more detail of how to configure for ROM/RAM downloading.<p>Note: You need to have a 32K-byte ram (62256) to load the test.c program.<p>
nmitech
08-14-00, 11:26 AM
Try the TINYTEST.C program below if you only have 8K-byte of ram on U3 socket.<p>/* Small program prints character A - Z to serial. <br> It will run with 8k ram installed on U3, and need to<br> re-setup the memory map in CLIB\COMMON51.C<br> as below:<p> ; MEMORY MAP FOR U3 RAM DEVELOPMENT =====================================<br> .EQU RAM,H'8000 ; starting address of data RAM, NEVER 0!<br> .EQU STACKTOP,H'8200 ; initial stack pointer, MUST BE EVEN!<br> .EQU ROM,H'8200 ; starting address of program ROM, usually 0<br> .EQU LITROM,H'9E00 ; ROM address where literals will be stored<p>*/<br> <br>#include clib\common51.c<br>#include clib\syslib51.c<br>#include clib\stdio.h<br>#include clib\fputc.c<p>main() <br>{<br> int i;<br> <br> /* print A to Z to serial */<br> for(i=0x41; i < 0x5A; i++)<br> fputc(i,stdout);<p> /* back to monitor prompt */<br> #asm<br> LJMP H'30<br> #endasm<br>}<br>
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.