View Full Version : 8031 Assembly file load
I decided that c coding was much less strenuous than BASIC so I am trying to get the assembler to work for the LCD.asm file on the disk. I have the components that came on the board in the same locations, and I can write to the LCD using commands, but the file will not load correctly.
I push L to load the file and then hit Ctrl+D to choose the file lcd.obj (assembled using assembler). It begins to go and then I get a lot of "invalid command or format errors". Any help would be appreciated
nmitech
03-18-02, 10:09 AM
At the terminal mode, press ALT+P, make sure the PACING character is set for decimal 10 and hit Enter to save it.
At the monitor prompt, enter L then press ALT+D and enter the complete path of the lcd.obj to download.
Wait until the file is loaded, enter X 8400 to execute the lcd program. You will see the message "HELLO WORLD" displays on the 1 row and " This is a test" displays on the 2nd row of LCD.
Great, that worked well and I can run the example .asm files. Now, I can also compile and assemble C files using the software on the disk. I want to put the code on RAM, but then when I use the X 8000 command, it won't run. Do I need to change jumpers and the common51 file or can I do something easier? Thanks.
nmitech
03-19-02, 09:17 AM
Before you compile a smallC program, make sure you put the code address, data, stack, etc... in the common51.c file to where you want the code to be loaded. The common51.c has all the default addresses setup for ROM standalone application. Please read the appnote01.txt file for detail on how to setup for RAM configuartion also.
I am unable to get one of my programs to run. I was able to get the tinytest file to run by following those instructions given in the comments of the file. I was also able to get the lcdtest to work. I am trying to get a larger file (obj = 23k) to work but I can't get it to work.
I tried getting it to work just like the tinytest and lcdtest, and it did nothing. I changed the jumpers to match appnote01.txt (h2 to 1,2; h3 to 2,3; h4 to 1,2) and apply the correct changes to the memory map as shown.
.EQU RAM,H'0001 ; starting address of data RAM, NEVER 0!
.EQU STACKTOP,H'8000; initial stack pointer, MUST BE EVEN!
.EQU ROM,H'8000 ; starting address of program ROM, usually 0
.EQU LITROM,H'E000 ; ROM address where literals will be stored
I think that since I have no device in U4 and a 32k Ram in U3, it should be different than that given in appnote. Can you tell me what the memory map for the processor is for this configuration?
Also, is there a data book for the processor available.
Thanks
nmitech
03-21-02, 01:45 PM
To config the program and data memory in the common51.c file, First you need to know the NMIY-0031 hardware memory decodings and the memory devices those are available on your board.
NMIY-0031 memory decodes,
U2 - 0x0000-0x7FFF ( Program only. Currently the monitor is installed)
U3 - 0x8000-0xFBFF ( Program/Data. You have 32KByte as said in the previous post)
U4 - 0x0000-0x7FFF ( Data only. Currently is empty)
So the only memory available to load your program is U3. Here is what i would suggest
.EQU RAM,H'8040; I put it above the secondary interrupt vectors location.
.EQU STACKTOP,H'FC00; Top of the 32K ram and below the peripheral registers, such as LCD, keypad etc...
.EQU ROM,H'8400 ; Just above 1K of variables area.
.EQU LITROM,H'E000 ; ROM address where literals will be stored. Just gives it some room and above the program area.
Also, is there a data book for the processor available?
For your reference, You can download the documents from the following links. The documents are for newer processors but they are pin to pin compatible and most of the chip features are the same except there is no Timer2 (T2 & T2EX), half of internal ram size, and no power saving features on the processor of the NMIY-0031.
http://www.infineon.com/cmc_upload/migrated_files/document_files/Datasheet/d501.pdf
http://www-us10.semiconductors.philips.com/acrobat/datasheets/80C31_80C32_1.pdf
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.