Operational Amplifier Version 1.0
Chapter 9 Sample Code
9 Sample Code
main.c
#include "mb95430.h" #include "TypeDef.h"
*/ | |
/* Amplifier Setting |
|
*/ | |
void AmpOpenLoop() |
|
{ |
|
DDR6_P60=0;
DDR6_P61=0;
DDR6_P62=1; OPCR=0x60;//Amplifier gain is R3/R1
}
void AmpCloseLoop()
{
DDR6_P60=0;
DDR6_P61=0;
DDR6_P62=1; OPCR=0x40;//Amplifier gain is 20V/V
}
void main(void)
{
__DI();
__set_il(3); InitIrqLevels();
WDTH =0xA5;
WDTL =0x96;
WATR =0xEE;
SYCC =0xF0;//Main Clock SYCC2=0xF4;//Main Clock SYSC =0xBC;//BUZZ(P01)
SYSC2 =0x02;//PPG(P73),Disable I2C while(!STBC_MRDY);
__EI();
AmpOpenLoop();
AmpCloseLoop();
}
VECTORS.C
#include "mb95430.h"
void InitIrqLevels(void)
{