1379 views|3 replies

3836

Posts

19

Resources
The OP
 

Program for MSP430F5529 and MAX7456 character overlay module [Copy link]

This post was last edited by fish001 on 2019-8-8 22:51

I didn't use Keil, I used IAR.

The MCU source code is as follows:
#include <msp430f5529.h>
#include "SPI.h"
#include "MAX7456.h"

#define uint unsigned int
#define uchar unsigned char
#define ulong unsigned long

void initClk(){
UCSCTL3 |= SELREF_2; // Set DCO FLL reference = REFO
UCSCTL4 |= SELA_2; // Set ACLK = REFO

__bis_SR_register(SCG0); // Disable the FLL control loop
UCSCTL0 = 0x0000; // Set lowest possible DCOx, MODx
UCSCTL1 = DCORSEL_5; // Select DCO range 24MHz operation
UCSCTL2 = FLLD_1 + 243; // Set DCO Multiplier for 12MHz
// (N + 1) * FLLRef = Fdco
// (243 + 1) * 32768 = 8MHz
// Set FLL Div = fDCOCLK/2
__bic_SR_register(SCG0); // Enable the FLL control loop
__delay_cycles(375000);

// Loop until XT1,XT2 & DCO fault flag is cleared
//等待起震
do{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
// Clear XT2,XT1,DCO fault flags
SFRIFG1 &= ~OFIFG; // Clear fault flags
}while (SFRIFG1&OFIFG); // Test oscillator fault flag

}

void main(){
P1DIR |= BIT0; // P1.0 set as output

WDTCTL = WDTPW + WDTHOLD;
MAX7456_Delay_mS(1000);
initClk();
initSPI();
initMAX7456();
// spiWriteReg(VM0,OSD_EN);
// Max7456_Learn_Char(uchar number, uchar *data);


MAX7456_Write_Char_XY(0x05,0x08,0x0C); //Display 'B'
// MAX7456_Write_Char_XY(0x0A,0x08,0x0D); //Display 'C'
MAX7456_Delay_mS(1000);
spiWriteReg(VM0,0X48); //Set to PAL auto mode display OSD enable
// Max7456_Display_AllChar();

P1OUT = BIT0;
MAX7456_Delay_mS(10000);
P1OUT = 0x0000;

__bis_SR_register(LPM0_bits); // Enter LPM0
__no_operation(); // For debugger


while(1){

// spiWriteReg(VM0,0X48); // Set to PAL automatic mode to display OSD enable

// MAX7456_Delay_mS(9000); // Delay
// spiWriteReg(DMM,0X04); // Clear video memory
}
}

This post is from Microcontroller MCU

Latest reply

I will send you the latest version of the development data later   Details Published on 2019-11-3 17:13
 

125

Posts

0

Resources
2
 

Very good sharing

This post is from Microcontroller MCU
 
 

125

Posts

0

Resources
3
 

The MAX7456 single-channel monochrome on-screen display (OSD) generator eliminates the need for external video drivers, sync separators, video switches, and EEPROMs, effectively reducing system costs. The MAX7456 features 256 user-programmable NTSC and PAL...

This post is from Microcontroller MCU
 
 
 

125

Posts

0

Resources
4
 

I will send you the latest version of the development data later

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