This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AT89C51RE2 problems

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

Parents
  • 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

Reply
  • 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

Children
  • 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.

    Erik

  • 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?

    Best regards
    henrik

  • "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

    Erik

  • 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.

    Best regards
    Henrik

  • A lot of people who need larger programs looks at ARM or similar chips.

  • 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.

    Actually this is the first time I hear about the RE2. I guess it is either very new of rarely used.

    Have you had a look at the SILabs f12x/f13x series (100 MHz one-clockers with 128k flash, 8k RAM, 2 UARTs, SPI, IIC, ADC, kitchen sink) they are very popular chips and I just love them

    Erik

  • @ Per: Yes, I am aware of the ARM. We actually use the ST ARM7 and 9 quite extensively. However, this particular project is an extension of the RD2 project, so we wanted to reuse all the existing code with as little modification as possible.

    @ Erik: I will look into the Silabs chips. My main requirements is 2 uarts and the ability to reuse my C51 application code.

    Thank you all for your answers.

    Best regards
    Henrik