XRAM and Memory Model

Hi everybody!

I'm using a uC ADuC842 (based in 8052 core). It has 2 KB of XRAM On-Chip.

I have a test program (C code) which do some operations with float numbers and send results to the serial port.

When I use this compiler configuration:
- Memory Model: small: variables in DATA
- Code ROM Size: Large: 64K program

I haven't any problem and compiled code runs perfectly in ADuC842.

When I change compiler configuration to:
- Memory Model: Large: variables in XDATA
- Code ROM Size: Large: 64K program
- Check Boxes selected:
+ Use On-Chip ROM (0x0-0xF7FF)
+ Use On-Chip XRAM (0x-0x7FF)

I simulate compiled code with uVision and it runs perfecly (like before), but when I run compiled code in ADuC842 it doesn't work.

It seems that I have problems using XRAM, but I don't know where.

Sombody can help me?

Comment: I have researched along the Disscusion Forum and I have read that it's necessary use startup.a51 to initialize uC. I don't know how call that segment in my C code program. Can this solve my problem?

Thaks!!

Parents
  • Thanks to Andy and Erik!!

    Usuing your tips and looking along the Discussion Forum I could solve my problem.

    I'm going to remark some thing that I've found in this formums. This tips are copy & paste form other post, I hope nobody can be angry. I only do it to help someone who has a problem like me.

    - Check Boxes "Use On-Chip ROM (0x0-0xF7FF)" and "Use On-Chip XRAM (0x-0x7FF)" doesn't change uC configuration, It only configure uVision Simulator.

    - If you want to use XRAM, you need congirue your uC using START_AD.A51 and modify it to indicate to compiler that your uC has XRAM available. I've change this three lines:

    XRAMEN EQU 1
    EXSP EQU 1
    XDATALEN EQU 7FFH


    More information:
    http://www.keil.com/forum/docs/thread4770.asp
    http://www.keil.com/support/man/docs/c51/c51_ap_startup.htm


    Thanks Everybody!!!

    NOTE: Sorry! I've posted two times the same message. I had a probrem with my Web Browser and I sent it two times

Reply
  • Thanks to Andy and Erik!!

    Usuing your tips and looking along the Discussion Forum I could solve my problem.

    I'm going to remark some thing that I've found in this formums. This tips are copy & paste form other post, I hope nobody can be angry. I only do it to help someone who has a problem like me.

    - Check Boxes "Use On-Chip ROM (0x0-0xF7FF)" and "Use On-Chip XRAM (0x-0x7FF)" doesn't change uC configuration, It only configure uVision Simulator.

    - If you want to use XRAM, you need congirue your uC using START_AD.A51 and modify it to indicate to compiler that your uC has XRAM available. I've change this three lines:

    XRAMEN EQU 1
    EXSP EQU 1
    XDATALEN EQU 7FFH


    More information:
    http://www.keil.com/forum/docs/thread4770.asp
    http://www.keil.com/support/man/docs/c51/c51_ap_startup.htm


    Thanks Everybody!!!

    NOTE: Sorry! I've posted two times the same message. I had a probrem with my Web Browser and I sent it two times

Children
More questions in this forum