1442 views|0 replies

1140

Posts

0

Resources
The OP
 

MSP430G2553 collects AC VPP [Copy link]

/*P1.1 detects VPP, the minimum sampleable is 40HZ*/ #include "msp430g2553.h" unsigned int table_Valu[128] = {0}; //Store ADC10 sampling data float y,vpp; void ADC10_WaveSample(unsigned char inch); void ADC10_init(); void main(void) { int k=0,max,min; WDTCTL = WDTPW + WDTHOLD; // Stop WDT BCSCTL1 = CALBC1_12MHZ; // Set range DCOCTL = CALDCO_12MHZ; // Set DCO step + modulation DCOCTL = DCOCTL&0xE0; //Turn off the mixer and get the pure frequency ADC10_init(); WDTCTL = WDT_ADLY_1000; // WDT 1000ms, ACLK, interval timer IE1 |= WDTIE; _enable_interrupts(); while(1) { ADC10_WaveSample(1); max=table_Valu[1]; min=table_Valu[1]; for( k=0;k<128;k++) { if(table_Valu[k]>max) max=table_Valu[k]; if(table_Valu[k]
MSP430G2553 collects AC VPP


This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list