I read the following document to add a NOP before the LJMP at address 0000h. (http://www.keil.com/support/docs/1622.htm, Size 5,096 bytes, Jun 20, 2000) But, I'm still not clear on how to do it. I followed the instructions, but nothing was changed in the final object code. I'm using uVision2 IDE. Do I need to specify the new directory for startup.a51? Where? The reason I want to do this is because my 8032-based board is not getting set up properly at power up. It was suggested to try this. Only after a manual reset, the program executes properly. The RC power-up reset is 100ms.
Are you sure, that your hardware is working properly? I have had a 80C552 project and some boards behaved strange on setup. The variables in the data segment were not set up properly (all 0xff and all bit variables were 1). After replacing the processor, the problem was gone. After telling my customer to take care against ESD when handling the boards the problem disappeared completely. Just an idea... maybe it helps.
All, Finally, I was able to add the the NOP at the begining of my code. Now, I get an error 65: access violation at 0x001B: no excecution/read permission. What does this mean? In MicroVision2 I set up the code memory start address at 0x0000 and size 0x8000, the XDATA start at 0x8000 and size 0x8000, and the interrupt vectors at 0x0005. Do I need to modify anything else in the STARTUP.A51 file?
All, I noticed that after I changed the interrupt vector to start at 0x0005 to prevent space memory overlap, the debugger would give me the error I previously mentioned. Using the debugger, I found out that when an interrupt was generated the program would go to the address the int vector was supposed to be before the shift. Why the new address is not updated? Regards, Carlos
Adding one NOP before the LJMP at 0 will make the last byte of the LJMP store at location 3 which is the vector for EI0. Thus if you add a NOP you can not use EI0. This makes absolutotally no sense to me. Erik
Yes, the 3rd byte of the LJMP gets stored at 0003h. But, since I have the option in uVision2 to change the address vector location, I thought it would solve that problem. It didn't give me a compiler error, but when I ran the program and the first interrupt was generated, the program jumped to the original address, not the new shifted address (if this is even possible).
The uVision2 Simulator simulates the REAL microcontroller. There is no way to change where the REAL interrupt vector starts on an 8051. Therefore, there is no way to change it in the simulator. Why is a NOP needed before the LJMP? I assume you are doing that because of a reset/startup issue with the power supply. Will 1 instruction (1/1,000,000 of a second) help the power supply stabalize? Why not leave the reset vector alone and jump to a delay loop that lasts for 100msec or so? What you are doing makes interrupt 0 unusable. I'm pretty certain the chip designers didn't have that in mind when they developed the silicon. Jon
http://www.keil.com/support/docs/1622.htm The comma at the end of that link was interfering with the hypertext transfer. The interrupt vectors in the 8031 are at: 0003H IE0 000BH TF0 0013H IE1 001BH TF1 0023H RI+TI So you've only got 3 bytes to work with at 0000H for the reset vector, without interfering with IE0; and your error at 001BH may be associated with Timer 1. Both SJMP and AJMP are two byte branches.