#include
heat();
INIT_PLL();
timer_init();
while(1)
{
for(hang=0;hang<16;hang++)
{
for(day=0;day<4;day++)
{
shuru(ziku[zi][2*hang]);
shuru(ziku[zi][2*hang+1]);
}
shuru1();
hangxuan(hang);
shuchu();
}
}
unsigned char j=0;
for(j=0;j<8;j++)
{
RI=((data<
CP=0;
asm NOP;
CP=1;
asm NOP;
}
unsigned char j=0;
for(j=0;j
{
if(j<64)
{
RI=1;
CP=0;
asm NOP;
CP=1;
asm NOP;
}
else
{
RI=((ziku[(j-64)/16][2*hang+((j)>7? 1:0)]<<(j%8))&0x80)==0x80? 1:0;
CP=0;
asm NOP;
CP=1;
asm NOP;
}
}
SC=0;
asm NOP;
SC=1;
asm NOP;
A=P&0x01;
B=(P>>1)&0x01;
C=(P>>2)&0X01;
D=(P>>3)&0X01;
CT=1;
DisableInterrupts;
SC=0;
CP=0;
A=0;
B=0;
C=0;
D=0;
RI=0;
CT=1;
DIR=0XFF;
EnableInterrupts;
CLKSEL &= 0x7f; //set OSCCLK as sysclk
PLLCTL &= 0x8F; //Disable PLL circuit
CRGINT &= 0xDF;
#if(BUS_CLOCK == 40000000)
SYNR = 0x44;
#elif(BUS_CLOCK == 32000000)
SYNR = 0x43;
#elif(BUS_CLOCK == 24000000)
SYNR = 0x42;
#endif
REFDV = 0x81; //PLLCLK=2×OSCCLK×(SYNDIV+1)/(REFDIV+1)=64MHz ,fbus=32M
PLLCTL =PLLCTL|0x70; //Enable PLL circuit
asm NOP;
asm NOP;
while(!(CRGFLG&0x08)); //PLLCLK is Locked already
CLKSEL |= 0x80; //set PLLCLK as sysclk
//CLKSEL &= 0x7f; //set OSCCLK as sysclk
TSCR1_PRNT=0; //Enable pre-scaling
TSCR2 = 0x87; // Enable overflow interrupt 128 division
TCNTH=((unsigned int)(-20000))/256; //500ms
TCNTL=((unsigned int)(-20000))%6;
TFLG2_TOF=1; //Clear overflow interrupt flag
TSCR1_TEN=1; //Enable timer
TFLG2_TOF=1; //Clear overflow interrupt flag
TCNTH=((unsigned int)(-20000))/256; //500ms
TCNTL=((unsigned int)(-20000))%6;
this++;
if(shu==128)
{
this=0;
}
Keywords:MC9S12XS128 LEDP10 display
Reference address:MC9S12XS128 drives LEDP10 display
#include "derivative.h"
#define B PORTA_PA0 //Data serial input clock
#define C PORTA_PA2 //Data output clock
#define PORTA_PA1 //define
#define CP PORTA_PA5 //Line selection
#define SC PORTA_PA6 //Line select
#define RI PORTA_PA3 //Serial data
#define CT PORTA_PA7
#define DIR DDRA //Data direction
#define BUS_CLOCK 32000000 //Bus frequency
unsigned char ziku[4][32]={
0xFB,0xBF,0xFB,0xBF,0xC0,0x03,0xFB,0xBF,0xFB,0xBF,0x80,0x01,0xFB,0xBF,0xF7,0xDF,
0xEE,0xEF,0xDE,0xF7,0x3E,0xF9,0xEE,0xAF,0xEE,0xD7,0xDE,0xD7,0xFA,0xFF,0xFD,0xFF,
0xFE,0xFF,0x80,0x03,0xFE,0xFF,0xC0,0x07,0xFF,0xFF,0xE0,0x0F,0xEF,0xEF,0xE0,0x0F,
0xFB,0xBF,0x00,0x01,0xFF,0xFF,0xE0,0x0F,0xEF,0xEF,0xEF,0xEF,0xE0,0x0F,0xFF,0xFF,
0xFD,0xFF,0xDD,0xBF,0xDD,0xCF,0xDD,0xEF,0x80,0x01,0xDB,0xFF,0xFB,0xFF,0xF8,0x1F,
0xF3,0xDF,0xF5,0xDF,0xF5,0xDF,0xEE,0xBF,0xDF,0x7F,0xBE,0x9F,0x79,0xE3,0xE7,0xF7,
0xFF,0xF7,0x81,0xF7,0xBD,0xF7,0xB5,0xF7,0xB5,0x01,0xB5,0xE7,0xB5,0xE7,0xB5,0xD7,
0xB5,0xD7,0xB5,0xB7,0xF7,0xB7,0xEB,0x77,0xED,0xF7,0xDC,0xF7,0xBD,0xD7,0x7F,0xEF
};
void init();
void shuru(unsigned char data);
void shuchu();
void delay(unsigned char p);
void hangxuan(unsigned char P);
void timer_init();
void shuru1();
void INIT_PLL(void);
unsigned char hang=0,zi=0,shu=0;
void main(void)
{
}
void shuru(unsigned char data)
{
}
void shuru1()
{
}
void shuchu()
{
}
[page]
void hangxuan(unsigned char P)
{
}
void init()
{
}
void INIT_PLL(void)
{
}
void timer_init()
{
}
#pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt void timer()
{
}
Previous article:About reentrant functions and simulated stacks
Next article:Using printf function in Keil
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
Guess you like
- EK140P Linux-4.1.15 Test Manual
- EEWORLD University Hall----Live Replay: HARTING- How to quickly and cost-effectively install cables in electrical control cabinets
- Introduction to Machine Vision Technology
- 【RT-Thread Reading Notes】1. RT-Thread RTOS Preface
- I would like to ask about an EXCEL curve fitting formula. I cannot get the value of Y by substituting the values of X (0, 150, 300). The value of Y is not correct.
- EEWORLD University ---- Sensors and Testing Technology
- The first question after the New Year is how dare I use this IGBT driving current.
- Bluetooth module interfaces
- Five factors to consider when designing a fixed wireless access (FWA) system
- Weak Bluetooth signal strength and excessive static power consumption of the product