[Use of TLV5638 – controlled by MSP430F5529]

TLV5638 use foreword hardware circuit software driver Control Timing Analysis official example main function full code some problems output result Foreword The subject is preparing for the 2023 National Undergraduate Electronic Design Competition, and used a voltage-controlled gain amplifier when practicing the topic. The MSP430F5529 microcontroller used does not have an on-chip DAC, so TLV5638 […]

MSP430F5529 and HC-SR04 Ultrasonic Ranging

Principle 5529 sends a high level greater than 10us to Trig, the HC-SR04 module starts to work, Echo sends a high level to 5529 and sends out a signal at the same time, when receiving the return signal, Echo ends the high level transmission. Therefore, the measured distance = (high level time * speed of […]

MSP430F5529 timer A configuration timing interrupt

Introduction Three timers TA0, TA1, TA2 can be configured as continuous counting mode, up counting mode, up and down counting mode. The three compare capture registers of each timer can be configured as compare count mode or capture mode respectively. * Timer_A_initUpModeParam; Interrupt after TIMA 0->TAxCCR0 overflow * Timer_A_initContinuousModeParam; TIMA 0->0xFFFF interrupt after overflow * […]

MSP430F5529PID Algorithm Closed-loop Control Motor Speed

Code #include “driverlib.h” #include “stdio.h” #include <string.h> #include <stdarg.h> static int capz=0; static int capy=0; static int error=0; static int aim=40; static int allerr=0; static int previouserr=0; static int altererr=0; static int output=0; static float kp=4.0; static float ki=0.1; static float kd=2.0; void uartinit1() { GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P4,GPIO_PIN5); GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P4, GPIO_PIN4); USCI_A_UART_initParam param1 = {0}; param1.selectClockSource = USCI_A_UART_CLOCKSOURCE_SMCLK; […]

MSP430 ADC12 module usage and code (register)

Take my MSPf5529LP as an example, it has a total of 16 input channels A0-A15, 12 of which are external channels. Correspondingly, there are quite a lot of various registers in the ADC12 part, which will be introduced one by one next, and some codes are still attached at the end. Directory Register introduction ADC12CTLn […]

MSP430 timers and routines (registers)

I will not elaborate on the principles of timer-related timers, PWM, and input capture. Those who start learning MSP430 must have a certain foundation. Without further ado, let’s get straight to the point. MSP430 has a lot of timer resources, let’s count them as four: TA0, TA1, TA2, TB (TB0), the number of resources they […]

Four-pin OLED display (register) for MSP430f5529LP

Although it is a register operation, it has little influence as a peripheral. Just change the macro definitions of set and clr in oled.h. Not much to say, just upload the code directly, and you can check the wiring in oled.h by yourself. Note that a four-pin OLED is used here. code of type.h #ifndef […]

MSP430F5529 microcontroller, perpetual calendar, alarm clock, digital clock, temperature and humidity dht11, buzzer music

Article directory Function hardware connection in kind program Function Function 1 perpetual calendar display 2 keys to modify the time 3 buttons to modify the alarm clock 4 When the alarm clock arrives, the buzzer sounds for 10 seconds and automatically turns off. The alarm clock is music 5 temperature and humidity display 6 When […]

MSP430 library function – GPIO operation

The GPIO library function of MSP430 is used: 1. Summarize first: //Initialize IO to output mode GPIO_setAsOutputPin(uint8_t selectedPort,uint16_t selectedPins); //In output mode, output IO is high level GPIO_setOutputHighOnPin(uint8_t selectedPort,uint16_t selectedPins); //In output mode, the output IO is low level void GPIO_setOutputLowOnPin(uint8_t selectedPort,uint16_t selectedPins); //In output mode, invert the IO level void GPIO_toggleOutputOnPin(uint8_t selectedPort,uint16_t selectedPins); //Set […]