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!!
"It seems that I have problems using XRAM, but I don't know where." Probably your processor has some configuration register(s) that need to be set up - you will need to read the Data Sheet to find out. Or maybe some of the other ADuC8... example projects can help: http://www.keil.com/download/list/c51.htm Have you looked on the AD website for any info? " 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." You don't - it is actually startup.a51 that calls your 'C' code! You simply need to add startup.a51 to your uVision Project - then it will automatically be built and linked-in as required. There is a section in the C51 Manual all about startup.a51
You don't - it is actually startup.a51 that calls your 'C' code! You simply need to add a modified version of startup.a51 to your uVision Project - then it will automatically be built and linked-in as required. ... if there is a SFR to set in order to use internal XRAM. Erik
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
"- 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." Not quite: these boxes are used principally by the Linker. The Linker (specifically, the Locator function within the Linker) is the part of the toolchain that assigns physical memory addresses to your code & data objects. These check-boxes simply inform the linker about how much ROM and XRAM space you have, and at what memory addresses; They enable the Linker to give you a warning if your code and/or data strays outside the specified limits.
It's about time Keil got rid of that 'Use on chip XRAM' checkbox. With all these new derivatives it is quite understandably causing a lot of confusion.
I do not think that we should get rid of this check box. It only needs a better wording. Maybe a good task for this discussion forum: "Give us a suggestion for re-wording" Thank you
"Give us a suggestion for re-wording" How about: "Use XRAM size from chip database"
"Use XRAM size from chip database" The check-box specifies both the size & the addresses, so I think "Use XRAM address range from chip database" would be better; similarly for ROM. It still needs to be made crystal clear that this does not generate any config code! In my uVision v2.39, if I click on the '?' button and then on this check box, I just get "No help topic is associated with this item" The F1 key is completely ignored.
"The check-box specifies both the size & the addresses" I can't think of a derivative that doesn't map it's XRAM from 0. Can you? "It still needs to be made crystal clear that this does not generate any config code!" I was hoping that "Use XRAM size..." in the context of the XRAM range boxes would be enough. I can't see any way of making it 100% clear without having the statement "This does not mean that the XRAM present in your derivative will actually work unless you configure it to do so manually. There is probably an SFR that you'll need to write to." beside the checkbox, but this would be most unattractive. "In my uVision v2.39, if I click on the '?' button and then on this check box, I just get "No help topic is associated with this item" The F1 key is completely ignored." I gave up trying to use help facilities in applications a long time ago as they are always useless. It's an ISO standard: all conforming applications must have hopeless help.
"I gave up trying to use help facilities in applications a long time ago as they are always useless." Defeatist!