Main Page   Hardware Class Hierarchy   Hardware API     Mapping Class Hierarchy  Mapping API 

oProcessor Class Reference

A class (hardware layer) that defines attributes that are applicable to any generic processor. methods should be valid on any processor, although implementation my vary. Mostly the SIM module on 68332. More...

#include <oprocessor.h>


Public Member Functions

 oProcessor (CLOCK)
 Constructor setting system clock speed because.


Static Public Member Functions

void system_clock (CLOCK)
 Sets the system clock to specified rate.

CLOCK system_clock (void)
 Return system speed (Ref. CLOCK).

bool reset_status (STATUS)
 Return Reset Status Register (STATUS out of reset).


Static Public Attributes

SIM_T * SIM
 Global object.


Detailed Description

A class (hardware layer) that defines attributes that are applicable to any generic processor. methods should be valid on any processor, although implementation my vary. Mostly the SIM module on 68332.

Remarks
The reset_status method was disappointing; in my testing it seemed sometimes to power up with POWERUP and sometimes with EXTERNAL. It was not useful for catching brown-outs as I had hoped. If anyone else has more success place let me know. The reset button, though, will always generate an EXTERNAL reset. Also, I failed to be able to generate a watchdog reset. The 68322 speed is derived from two primary sources:

Once system speed is set, the clock speed on the TPU port is modified by use of the clock prescaler (TCR1P/PSCK Ref: TPU reference manual 2-2) in the time processing unit (TPU)

Sample Code
#include <oconsole.h>
#include <oled.h>
#include <oprocessor.h>
int main(void)
{
oConsole debug;
oGreenLED green;
  green.on();
  debug.echo("Debugging on...\n");

oProcessor MRM;
  if (MRM.reset_status(POWERUP)) debug.echo("Reset caused by Powerup\n");
  MRM.system_clock(MH25);
  debug.syncronize();
  debug.echo("After clock change..\n");
  if (MRM.system_clock() == MH8) 
    debug.echo("8 MHZ\n"); else
  if (MRM.system_clock() == MH16)
    debug.echo("16 MHZ\n"); else
  if (MRM.system_clock() == MH25)
    debug.echo("25 MHZ\n");
  else
    debug.echo("Unknown Speed detected!"); 
  green.off();
  exit(0);
}


Constructor & Destructor Documentation

oProcessor CLOCK   ) 
 

Constructor setting system clock speed because.

Remarks:
If you declare the oUART it will be at the current clock speed, so oProcessor must be declared before the oUART to work.
:


The documentation for this class was generated from the following file:
Generated on Mon Oct 8 19:32:45 2007 for OOMRM Hardware API by doxygen1.3