Previous

Next

Bottom

Contents

Glossary

Index

 

Persistor CF1 User's Manual

Chip Select Wrapper Functions

Sept 1999

Revision 1.02

 Persistor Instruments Inc.
© 1998 All rights reserved.

 

Quick Reference Table

CS10isEClock

CSGetSysWaits

CS10Options

CSInit

CS10Setup

CSNotifyPostClockChange

CS8Options

CSNotifyPreClockChange

CS8Setup

CSSetSysAccessSpeeds

CSCalcWait

CSSetSysWaits

CSGetSysAccessSpeeds

CSUpdateSysWaits

About the CS Functions

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.

 

CS10isEClock -- Define CS10 for its alternate ECLOCK function (default is chip select)

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

CS10Options -- Define the CS8 R/W access and wait states

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
canWrite is a boolean that is TRUE if the device can be written to
dsSync specifies whether the chip select should go low with the address strobe or the data strobe.
waits is the number of wait states to use with this device.

Notes:

Timing:

Timing-TBD

CS10Setup -- Setup CS10 address range and access width

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.
size is the amount of address space above the baseAddr that you would like to reserve for the specified device.
is16bit is a boolean that is TRUE if the device is 16 bits wide.

Notes:

Timing:

Timing-TBD

CS8Options -- Define the CS8 R/W access and wait states

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
canWrite is a boolean that is TRUE if the device can be written to
dsSync specifies whether the chip select should go low with the address strobe or the data strobe.
waits is the number of wait states to use with this device.

Notes:

Timing:

Timing-TBD

CS8Setup -- Setup CS8 address range and access width

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.
size is the amount of address space above the baseAddr that you would like to reserve for the specified device.
is16bit is a boolean that is TRUE if the device is 16 bits wide.

Notes:

Notes-???

Timing:

Timing-TBD

CSCalcWait -- Return wait states at given freq. for device access time

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.
nsAccess is the access time of the device in nanoseconds.

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

CSGetSysAccessSpeeds -- Return the device and bus wait timing

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
nsRAM s a pointer to a short which will contain the SRAM's access time
nsCF is a pointer to a short which will contain the CompactFlash's access time
nsBusAdj is a pointer to a short which will contain the bus adjustment time

Notes:

Timing:

approx. 14 µsecs @ 16 MHz

CSGetSysWaits -- Return the current wait states for the system memory

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
waitsRAM is a pointer to a short that will contain the SRAM's number of wait states
waitsCF is a pointer to a short that will contain the CompactFlash's number of wait states

Notes:

Timing:

approx. 20 µsecs @ 16 MHz

CSInit -- Setup automatic wait state adjustment

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

CSNotifyPostClockChange -- Adjust wait states after a clock change

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

CSNotifyPreClockChange -- Prepare wait states for a pending clock change

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

CSSetSysAccessSpeeds -- Define the device and bus wait timing

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)
nsRAM is the access time of the SRAM in nanoseconds. (Factory: 70)
nsCF is the access time of the CompactFlash in nanoseconds. (Factory: 190)
nsBusAdj is the integer to be added to each of the above. (Factory: -10)

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

CSSetSysWaits -- Set the system memory wait states

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.
waitsRAM is the number of wait states to be used with the SRAM
waitsCF is the number of wait states to be used with the Compact Flash.

Notes:

This function could potentially have catastrophic results.

Timing:

CSUpdateSysWaits -- Update the Flash, RAM, and CF wait states

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

 

Previous

Next

Top

Contents

Glossary

Index

Tel: 508-759-6434

Fax: 508-759-6436

Copyright (C) 1998 Persistor Instruments Inc. - All Rights Reserved