|
|
|
|
|
|
|
||
|
||
|
|
||
Sept 1999 |
Revision 1.02 |
|
Persistor Instruments Inc. |
© 1998 All rights reserved. |
|
The chip select collection of BIOS functions let you modify certain operating characteristics of onboard memory mapped devices as well as add your own memory mapped peripherals without having to directly manipulate the 68338 registers.
Historically CS10 has had two possible roles: one as a standard chip select and one as an alternate clock out. When in ECLK mode, CS10 simply outputs a clock at one eighth the frequency of the system clock. This function allows the user to switch between the two functions of the CS10 pin.
|
Prototype: |
void CS10isEClock(bool isECLK); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
isECLK is a boolean that is TRUE if CS10 is to be used as ECLOCK |
|
Notes: |
|
|
Timing: |
approx. 35 µsecs @ 16 MHz |
This function is called after calling CS10Setup to specify the characteristics of the device at CS10. This function tells the system wither the device can read, write or both, whether the chip select should go low with the address strobe or the data strobe and how many wait states to use during transactions.
|
Prototype: |
void CS10Options(bool canRead, bool canWrite, bool dsSync, short waits); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
canRead is a boolean that is TRUE if the device
can be read from |
|
Notes: |
|
|
Timing: |
Timing-TBD |
On the CF1 most of the hardware chip selects are used internally by parts that are on the board itself. However two remain free for your use. These are CS8 and CS10. The function CS10Setup allows you to specify how you would like CS10 to operate, if you wish to use it with one of your own memory-mapped peripherals. CS10Setup allows you to specify where in the memory map you would like to place your device and how much address space you would like to reserve for your device. The maximum amount of space that can be used is 1MB. You also need to specify how "wide" you device is by passing TRUE in is16bit if your device's word length is 16 or FALSE if it is 8 bits wide. (The 68338 has a 16 bit external bus so it does not support devices more than 16 bits wide.
|
Prototype: |
void CS10Setup(ulong baseAddr, long size, bool is16bit); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
baseAddr is the address where you would like your
memory mapped peripheral to reside. |
|
Notes: |
|
|
Timing: |
Timing-TBD |
This function is called after calling CS8Setup to specify the characteristics of the device at CS8. This function tells the system wither the device can read, write or both, whether the chip select should go low with the address strobe or the data strobe, and how many wait states to use during transactions.
|
Prototype: |
void CS8Options(bool canRead, bool canWrite, bool dsSync, short waits); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
canRead is a boolean that is TRUE if the device
can be read from |
|
Notes: |
|
|
Timing: |
Timing-TBD |
On the CF1 most of the hardware chip selects are used internally by parts that are on the board itself. However two remain free for your use. These are CS8 and CS10. The function CS8Setup allows you to specify how you would like CS8 to operate, if you wish to use it with one of your own memory-mapped peripherals. CS8Setup allows you to specify where in the memory map you would like to place your device and how much address space you would like to reserve for your device. The maximum amount of space that can be used is 1MB. You also need to specify how "wide" you device is by passing TRUE in is16bit if your device's word length is 16 or FALSE if it is 8 bits wide. (The 68338 has a 16 bit external bus so it does not support devices more than 16 bits wide.
|
Prototype: |
void CS8Setup(ulong baseAddr, long size, bool is16bit); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
baseAddr is the address where you would like your
memory mapped peripheral to reside. |
|
Notes: |
Notes-??? |
|
Timing: |
Timing-TBD |
This function takes a clock rate in kilohertz and an access time in nanoseconds and calculates the appropriate number of wait states for that device. This function does not make any changes to the CF1's wait state configuration.
|
Prototype: |
short CSCalcWait(ushort kHz, short nsAccess); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
kHz is the clock speed in kilohertz you wish to
use for your calculation. |
|
Returns: |
The lowest possible number of wait states for the given parameters. |
|
Notes: |
A return value of -1 means indicates the device can run in fast termination mode at the given clock speed. It does not indicate an error. |
|
Timing: |
approx. 45 µsecs @16 MHz |
This function retrieves the access times in nanoseconds of various components of the CF1 including the onboard flash, the RAM and the compact flash. The nsBusAdj is a number that gets added to each of the other numbers before they are passed to anything that calculates wait states.
|
Prototype: |
void CSGetSysAccessSpeeds(short *nsFlash, short *nsRAM, short *nsCF, short *nsBusAdj); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
nsFlash is a pointer to a short which will contain
the flash's access time |
|
Notes: |
|
|
Timing: |
approx. 14 µsecs @ 16 MHz |
|
Prototype: |
void CSGetSysWaits(short *waitsFlash, short *waitsRAM, short *waitsCF); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
waitsFlash is a pointer to a short that will
contain the flash's number of wait states |
|
Notes: |
|
|
Timing: |
approx. 20 µsecs @ 16 MHz |
This function initializes the Chip Select Management hardware and software subsystems of your CF1. In normal use, this function should never be called from a user application and is included here only in the interests of a complete function reference. It is normally called by the when the machine starts up.
|
Prototype: |
void CSInit(void); |
|
Definition: |
#include <cf1bios.h> |
|
Notes: |
|
|
Timing: |
approx. 450 µsecs @ 16 MHz |
This is a helper function that gives the system a chance to do any necessary tasks to recover after a change of system clock speed, as it relates to the wait states. This is not a function that would be called from a user's application, but it can be patched by a user that has additional memory mapped peripherals that may require special attention to timing after a clock change.
|
Prototype: |
void CSNotifyPostClockChange(void); |
|
Definition: |
#include <cf1bios.h> |
|
Notes: |
|
|
Timing: |
Timing-TBD |
This is a helper function that gives the system a chance to do any necessary tasks in preparation for a change of system clock speed, as it relates to the wait states. This is not a function that would be called from a user's application, but it can be patched by a user that has additional memory mapped peripherals that may require special attention to timing before a clock change.
|
Prototype: |
void CSNotifyPreClockChange(void); |
|
Definition: |
#include <cf1bios.h> |
|
Notes: |
|
|
Timing: |
Timing-TBD |
This function simply loads the access times in nanoseconds of various components of the CF1 including the onboard flash, the RAM and the compact flash. The nsBusAdj is a number that gets added to each of the other numbers before they are passed to anything that calculates wait states. Because the CF1 is so small and has virtually no bus capacitance, we can safely pass a -10 for nsBusAdj which allows the CF1 to operate with fewer wait states.
|
Prototype: |
void CSSetSysAccessSpeeds(short nsFlash, short nsRAM, short nsCF, short nsBusAdj); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
nsFlash is the access time of the flash part in
nanoseconds. (Factory: 100) |
|
Notes: |
This function simply loads the numbers into a table of static values, it does not affect any "physical" changes. |
|
Timing: |
approx. 10 µsecs @ 16 MHz |
This function allows the user to specifically set the wait states for the flash the SRAM and the CompactFlash. No error checking will be done, so this function has the potential to be catastrophic in results. Under normal circumstances it would probably be more prudent to use the access times of the parts and the clock frequency with the CSUpdateSysWaits function after loading the access times with the CSSetSysAccessSpeeds function.
|
Prototype: |
void CSSetSysWaits(short waitsFlash, short waitsRAM, short waitsCF); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
waitsFlash is the number of wait states to be used
for the onboard flash. |
|
Notes: |
This function could potentially have catastrophic results. |
|
Timing: |
Update the CF1's wait states based on access times loaded by the CSSetSysAccessSpeeds function. When this function is called, the appropriate number of wait states for each part is calculated based on the given clock frequency, and all transactions afterward will reflect the new number of wait states.
|
Prototype: |
void CSUpdateSysWaits(ushort kHz); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
kHz is the clock frequency that will be used to calculate the new number of wait states. |
|
Notes: |
|
|
Timing: |
Timing-TBD |
|
|
|
|
|
|
Tel: 508-759-6434 |
|
Fax: 508-759-6436 |
|
|
||