I am confused by the documentation. It states in the "Getting Started" book that the XTAL [directive in the Target dialog] specifies the CPU clock for my device. "In most cases this value is inentical with the XTAL frequency." When is it not? And if not what do I enter into the field? I am using the EZUSB part from Cypress. I believe that the actual CPU clock speed for a 12MHz crystal would be 48MHz. Should I enter 12 or 48?
Refer to the following knowledgebase article:
So, back to the original question, what should he type in the 'XTAL' box on the Target Options, and when would that differ from the crystal frequency?
"I am confused by the documentation. It states ... 'In most cases this value is identical with the XTAL frequency'" (my emphasis)
I think that should be a hanging offence for manual writers!
The purpose of the manual is to describe the product to the User - not to leave the reader with futher, unanswered questions!
OK, the fine detail might be in a footnote or something, but it must be there somewhere - and clearly referenced.
There's another one in that same table in the "Getting Started" Guide:
The description of 'Code Banking' and 'Xdata Banking' is, "Specifies the parameters for code and xdata banking. Refer to "Code Banking" on page 67 for more nformation."
The is absolutely no description at all of XDATA Banking!
I read that article in the first place and it did not answer my question either. It states that the CPU clock speed will be the result of dividing the Xtal frequency by an integer. The Cypress part has a PLL that brings the clock up to 24 or 48 MHz depending on boot configuration. Does the Keil compiler know this and adjust the clock speed up? How does it know what the boot configuration is? And, probably most importantly, what does this setting affect?
The target device is set correctly to: Anchor Chips EZUSB 8051.
And, probably most importantly, what does this setting affect?
Just a guess -- the elapsed processor execution time ("Regs" tab, in the "Sys" expansion) when simulating?
'In most cases this value is identical with the XTAL frequency'
This should probably read:
'This value is predefined to the maximum XTAL frequency specified for the device.'
When would you set this to a different value?
Well, if you use a device at 11.0592MHz, you should set the XTAL frequency to that number. Even though, the part CAN run at 12.000MHz.
Why would you do this?
The Keil simulator uses the XTAL frequency to establish timing values like how many real-time seconds it takes to execute instructions and serial port baud rate calculations.
Does the Keil simulator correctly simulate the timing behavoir of the devices?
In most cases, yes. However, you should consider that last year 2 8051-compatible devices were added each week of the year (100 per year). It takes about 1 month to add complete peripheral simulation support for a new device. If a totally unique device is created, it requires a minimum of 1 month before we totally simulate every part of that device.
Fortunately, most new devices are derivatives of devices already simulated completely. You can click on the Simulation link for a chip from the device database (http://www.keil.com/dd) to find out what on-chip peripherals are simulated. Most are simulated completely.
A default peripheral simulation driver is used for devices that are not completely simulated. This is indicated in uVision2 and on the web site for the list of simulated peripherals.
Currently the Cygnal devices are not fully simulated. The primary reason for this is that Cygnal offers a JTAG debugger that can interface to your target hardware. We are constantly adding simulation support for the devices that are not currently 100% simulated. However, this process takes time.
"The Keil simulator uses the XTAL frequency to establish timing values like how many real-time seconds it takes to execute instructions and serial port baud rate calculations."
As we guessed - but why doesn't the manual clearly tell us that?!
The point of having a manual is so that we can read it and know how to use the product - not try to guess what needs to be entered for a particular setting!!
We still don't know when we should enter the crystal frequency, and when we should enter something else; nor how to determine the "something else" value in those "unusual" cases!