We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have written my C code using uvision and tested it on the MCB517AC evaluation board. It works perfectly. But, when I use the .hex file( being created by uvision ) and program it into 89C52, through a Dataio Universal programmer, it works no more. Please help! The hardware setup for my 89C52 is a crystal 12 MHz connected to pin 18, 19. Pin 18 and 19 are also connected to a 27pF capacitor each, before being grounded. A push-down button and a 10uF capacitor is installed between 5V and the reset pin.
Did you change the Target Device and do a full rebuild of your whole Project?
I have changed the header file from <reg517a> to <at89x52.h>. I have changed from P4 to P3. I have ensured that all SFRs matches. I have done a full rebuild of the whole project. For the programming of the 89C52 chip using Dataio universal programmer, I have set the device to Atmel 89C52 and the format as Intel Hex 32. For yesterday, I have tried to program 'Blinky' example into 89C52, but it also does not work. Is the .hex file created by uvision not compatible to 89C52? Please help!!!
It must be worked ! That's compatible But be careful of doing a complete rebuild of your project after changing your device target.
The Intel hex file is created by a utility which takes the output of the linker and converts it to the right format. In the '167 environment you must specify a hex output in the Output tab of the project settings. What you need is to have two forms of the project, 'PROJ' and 'PROJ_UV' with different settings in the project setup. The 'PROJ_UV' is used for debugging in uVision and must have enough RAM to hold the program/constants. This RAM is usually external except for the smallest of programs. It must be specified as ROM in the External Memory portion of the project setup. After debugging you switch outputs to the 'PROJ' form which uses RAM for RAM and flash for code/constants. Then rebuild the entire project. Look at the linker map file to see if all code and constants are at flash addresses in your target and that all variables are at RAM addresses. As I said, this is from '167 experience, not '51 but the tools are roughly the same. Best luck Scott
I have finally discovered the culprit of my failure. It is the EA(External Access) pin of AT89C52. In the past, I did not connect this pin at all!!! I should have connect it to a high so that it will use internal ROM. Thanks for all who have tried to help in any ways!!!