Sample Code - Fujitsu MB95F430 Series Application Note

F²mc-8fx family 8-bit microcontroller operational amplifier
Hide thumbs Also See for MB95F430 Series:
Table of Contents

Advertisement

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)
{
Operational Amplifier Version 1.0
Chapter 9 Sample Code
MCU-AN-500080-E-10 - Page 16

Advertisement

Table of Contents
loading

Table of Contents