Hello everybody,
I am using the AT89C51RE2 controller and the AT89OCD debugger. I have set up my environment according to the application note from Atmel with the suggested modifications to startup51.a51 and l51_bank.a51. In lack of something better I have used 89c51rd2.H in my c file. The c file only contains void main() function. The project contains c-file and the two asm files.
My problem is this. When i download the hex and start a debug session, I am able to step the code, but the disassembly shows the same instruction everywhere. MOV r7,A and obviously nothing happens.
I cannot seem to figure this out, and this is my first time with the OCD and the AT89C51RE2. I wonder if something has to be done in the a51 files which I am not aware of or what could cause this problem in the first place.
Any help is gladly appreciated.
Thank you in advance. Henrik
The opcode for that is FF - so it looks like your EPROM is still in the erased state...?
Thank you for your fast reply. I have been digging a little myself, and I got to the same conclusion.
I wonder why this is happening. The OCD does not report any errors at all. Could it be related to something that is wrong in the standard asm files?
Best regards Henrik
I HAVE SAME ERROR AND I FOUND IT IN LINE 77 OF PROGRAM.C BCOZ I FORGOT SEMICOLON. YOU MUST CHECK FOR IT.
I am sorry,
I have no "program.c" and no semicolons missing. The project compiles nicely and appear to download correctly.
I HAVE ERROR IN PROGRAM BUT UVISION DID NOT SHOW IT BCOZ I USE MCAFEE VIRUS SCANNER. YOU LOOK AT KNOWLEDGE BASE AND YOU SEE IT IS PROBLEM. I ALSO HAVE ERROR IN THE FILE DIPSLAY.C SO YOU CHECK ALSO?
My project is now stripped down to an absolute minimum. Containing only the two A51 files and a c-file with nothing but a main function containing an endeless loop incrementing a variable. Still my problem persists.
The opcodes in the debugger is FF and no errors is given. Neither when compiling, nor when programming.
The OCD lights is according to specification, but I wonder if this could relate to faulty HW in some way?
I use my own custommade board.
Best regards henrik
Might the application be loaded at one address range, and the debugger show a dump from a different address range?
That might be possible. I am thinking that maybe the banking logics is incorrectly configured or something like that. I have followed the app. note to the letter, so I am a bit stuck as what to try next.
Does anybody have this microcontroller succesfully running with the Keil startup files at all?
My project is now stripped down to an absolute minimum.... maybe the banking logics is incorrectly configured or something like that.
Erik
Well, i agree that "absolute minimum" and "banking" creates an oxymoron when used in the same sentence. But a quick readthrough of the postings prior to this one might clue you in as to what i mean:
What I have done, is that I have created the setup detailed in the application note from Atmel on how to get started with Keil and banking on the AT89C51RE2.
This is my first project using this processor, although I have been using the RD2 part and others for several years.
My problem is still that when I compile and load the code, no errors or warnings are given, but the debugger shows opcode FF. The minimum I refer to is the fact that I only have the two a51 files from the app-note and a c-file så small that I am certain that no errors lie in there. And from what I can see, my setup is exactly as detailed in the app note.
I am really baffled by this, so any help is gladly appreciated.
Best regards. Henrik
void main (void) { SBUF = 0x30; } NO banking, NO optimization, NOTHING but the above.
this will show if the commands etc you use work. Then gradually add till it fails and then you will know where to look.
If I completely remove the banking scheme from my project and also remove the two A51 files. I can nownload code and make it work. So thank you Erik, for helping me isolate the problem. I now think that the problem lies in the app note and the a51 files. When I configured the files, there were some discrepancies between the files and the app notes.
Anyone know, if a working set of files are available somewhere? Or do I need to tailor my own? Perhaps I should mention that I ultimately plan on using RTX-Tiny for the application. I have used RTX-Tiny extensively on the RD2 device. Anyone have han any luck making it run on RE2?
"This is my first project using this processor [AT89C51RE2], although I have been using the RD2 part and others for several years."
So, can you get this working on the RD2?
Then look carefully at the differences between RD2 and RE2...?
I am very lucky, I do not use Atmel chips and thus this may not apply.
With the SILabs chips you need an unique banking scheme since AFAIK "just stating banking to Keil" will get you external code memory banking.
there is a possibility you can find some help in this www.silabs.com/.../an130.pdf
To Andy: The RD2 part does not have banked memory, so the problem does not apply there. The RE2 is actually just the bigger brother, adding one extra UART and more memory.
To Erik: Thank you, I will look into the link you provide. If I am lucky there will be something that helps me on my way.
What strikes we as odd, is that apparently noone else have had any problems. Since I am somewhat confident that I have understood and followed the app note to the letter, I suspect that perhaps this specific Atmel controller is not (yet) widely used... And those who do, are apparently taking on a different approach than I do.
A lot of people who need larger programs looks at ARM or similar chips.