I bought an oscilloscope from Amazon it is Hantek DSO5102P (Digital, 2 Channel, 100 MHz, 1 GSa/s)
I am trying to test it, I have an MSP430FR6989 development board (MSP-EXP430FR6989) and programmed it to toggle a pin (P4.7) every 0.5 ms to give me a square wave of period = 1 ms (f = 1 kHz).
This is the code for reference
#include <msp430.h>
#define ONE_MS 25;
#define ONE_SEC 25000;
#define ENABLE_PINS 0xFFFE
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
PM5CTL0 = ENABLE_PINS;
//init Timer
TA0CTL |= TASSEL__ACLK;
TA0CCR0 = ONE_MS;
//Taclk = .02ms faclk = 50Khz
//count = 0.5 ms/.02 ms = 25
//count = 1 sec / .02 ms = 25000
TA0CTL |= MC__UP;//count till TA0CCR0
P4DIR |= BIT7;//P4.7 output
P4OUT |= BIT7;
while(1)
{
if((TA0CTL & TAIFG) == 1)//if flag is set
{
P4OUT ^= BIT7;//toggle P4.7 every 0.5ms or 0.5s
TA0CTL &= (~TAIFG);//clear the flag
}
}
return 0;
}
I probed the pin with reference to ground and pressed the AUTOSET button, it gave me a square wave of period = 1.39 ms (f = 720 Hz).
EDIT1
I checked the compensation of my probe, I connected the probe's lead to the PROBE COMP ~5 V @ 1 kHz connector and the reference lead to the PROBE COMP Ground connector and got this waveform.
END OF EDIT1
Is that normal for oscilloscopes?
The community's help is very much appreciated.