3143 views|1 replies

2943

Posts

0

Resources
The OP
 

【Qinheng CH582】3 is equipped with zero power consumption LCD segment code screen [Copy link]

 

CH582M itself is a Bluetooth application, and its characteristic is low power consumption. For this reason, I equipped it with an LCD segment code screen with almost zero power consumption.

LCD segment code screens have static drive and dynamic drive .
Static drive : There is only one common terminal COM, and each pixel is led out by a separate electrode. The advantage is that the display effect is better than that of dynamic drive, and the disadvantage is that there are more pins.
Dynamic drive : There are 2 or more common terminals COM, and each electrode controls at least 2 pixels, which requires time division scanning to drive.
I use a statically driven LCD segment code screen. It can display 3 "8" and 2 ".", and a total of 24 IOs are required for control.

For simple display, COM and SEG only need to be at opposite levels, and they do not need to be displayed at the same level.

Use this simple segment screen to display data from subsequent tests.

#include "CH58x_common.h"

__attribute__((aligned(4))) UINT32 CapBuf[100];
UINT8V capFlag = 0;


void main()
{
UINT8 i;

SetSysClock(CLK_SOURCE_PLL_60MHz);

GPIOB_SetBits( GPIO_Pin_20 );
GPIOB_ModeCfg( GPIO_Pin_20, GPIO_ModeOut_PP_5mA );
GPIOB_SetBits( GPIO_Pin_22 ); GPIOB_ModeCfg (
GPIO_Pin_22, GPIO_ModeOut_PP_5mA );
GPIOB_SetBits( GPIO_Pin_10 ); GPIOB_ModeCfg( GPIO_Pin_10, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_12 ); GPIOB_ModeCfg( GPIO_Pin_12, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_19 ); GPIOB_ModeCfg( GPIO_Pin_19, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_0 ); GPIOB_ModeCfg( GPIO_Pin_0, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_2 ); GPIOB_ModeCfg( GPIO_Pin_2, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits ( GPIO_Pin_1 ); GPIOB_ModeCfg( GPIO_Pin_1, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_3 ); GPIOB_ModeCfg( GPIO_Pin_3, GPIO_ModeOut_PP_5mA ) ; GPIOB_SetBits( GPIO_Pin_5 ); GPIOB_ModeCfg( GPIO_Pin_5, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_7 ); GPIOB_ModeCfg( GPIO_Pin_7, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_11 ); GPIOB_ModeCfg ( GPIO_Pin_11, GPIO_ModeOut_PP_5mA ) ; GPIOB_SetBits( GPIO_Pin_13 ); GPIOB_ModeCfg( GPIO_Pin_13, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_15 ); GPIOB_ModeCfg( GPIO_Pin_15, GPIO_ModeOut_PP_5mA ); GPIOA_SetBits( GPIO_Pin_5 ); GPIOA_ModeCfg( GPIO_Pin_5, GPIO_ModeOut_PP_5mA ); GPIOA_SetBits( GPIO_Pin_0 ); GPIOA_ModeCfg ( GPIO_Pin_0, GPIO_ModeOut_PP_5mA ) ; GPIOA_SetBits( GPIO_Pin_2 ); ModeOut_PP_5mA ); GPIOA_SetBits( GPIO_Pin_15 ); GPIOA_ModeCfg( GPIO_Pin_15, GPIO_ModeOut_PP_5mA ); GPIOA_SetBits( GPIO_Pin_13 ); GPIOA_ModeCfg( GPIO_Pin_13, GPIO_ModeOut_PP_5mA ); GPIOA_SetBits( GPIO_Pin_11 ); GPIOA_ModeCfg( GPIO_Pin_11, GPIO_ModeOut_PP_5mA ); GPIOA_SetBits( GPIO_Pin_7 ); GPIOA_ModeCfg( GPIO_Pin_7, GPIO_ModeOut_PP_5mA ); GPIOA_SetBits( GPIO_Pin_9 ); GPIOA_ModeCfg( GPIO _Pin_9, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_8 ); GPIOB_ModeCfg( GPIO_Pin_8, GPIO_ModeOut_PP_5mA ); GPIOB_SetBits( GPIO_Pin_16 ) ; GPIOB_ModeCfg( GPIO_Pin_16, GPIO_ModeOut_PP_5mA );










































GPIOB_InverseBits(GPIO_Pin_20);

TMR0_TimerInit( FREQ_SYS / 30 ); // Set the timing time in ms
TMR0_ITCfg( ENABLE, TMR0_3_IT_CYC_END ); // Enable interrupt
PFIC_EnableIRQ( TMR0_IRQn );

while( 1 )
;
}

__INTERRUPT
__HIGH_CODE
void TMR0_IRQHandler( void ) // TMR0 scheduled interrupt
{
if ( TMR0_GetITFlag( TMR0_3_IT_CYC_END ) )
{
TMR0_ClearITFlag( TMR0_3_IT_CYC_END ); // Clear interrupt flag
GPIOB_InverseBits( GPIO_Pin_20 );
GPIOB_InverseBits( GPIO_Pin_ 22 );
GPIOB_InverseBits( GPIO_Pin_10 );
GPIOB_InverseBits( GPIO_Pin_12 ) ;
GPIOB_InverseBits( GPIO_Pin_19 );
GPIOB_InverseBits( GPIO_Pin_0 );
GPIOB_InverseBits( GPIO_Pin_2 );
GPIOB_InverseBits( GPIO_Pin_1 );
GPIOB_InverseBits( GPIO_Pin_3 );
GPIOB_InverseBits( GPIO_Pin_5 );
GPIOB_InverseBits( GPIO_Pin_7
); GPIOB_InverseBits( GPIO_Pin_11 )
; GPIOB_InverseBits
( GPIO_Pin_13 );
IO_Pin_5 );
GPIOA_InverseBits( GPIO_Pin_0 );
GPIOA_InverseBits( GPIO_Pin_2 );
GPIOA_InverseBits( GPIO_Pin_15 );
GPIOA_InverseBits( GPIO_Pin_13 );
GPIOA_InverseBits( GPIO_Pin_11 );
GPIOA_InverseBits( GPIO_Pin_7 );
GPIOA_InverseBits( GPIO_Pin_9 );
GPIOB_InverseBits( GPIO_Pin_8 );
GPIOB_InverseBits( GPIO_Pin_16 );

}
}

This post is from Domestic Chip Exchange

Latest reply

This is good, I look forward to your more brilliant works.  Details Published on 2022-3-14 13:09
 
 

6841

Posts

11

Resources
2
 
This is good, I look forward to your more brilliant works.
This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
Practical sine wave generating circuit diagram

Practical sine wave generating circuit diagram Author: Unknown Article Source: Unknown Practical sine wave gene ...

Protel 99 SE Application Technology Questions and Answers

Q: Can I use automatic routing for multi-layer circuit boards? Answer: Yes, it is the same as double-sided boards, just ...

Chip Packaging Overview

Chip packaging 1. DIP dual in-line package   DIP (Dual In-line Package) refers to an integrated circuit chip packa ...

[Video] C language video tutorial and assembly video tutorial (watch online)

C language video tutorial (online viewing) address: http://219.144.186.220/cyy/ Assembly language video tutorial (online ...

Solve the hidden BUG problem of the HX711 chip of the weight scale

I have done a project before, which has a weight detection function. I consulted a lot of information and finally loc ...

Learn MSP430F5529 programming routines

Press P2.1, LED1 lights up for 1s, quickly press P2.1 twice, LED2 lights up for 1s // Press P2.1, LED1 lights up for 1s ...

Gameboy that doesn't need to be charged

Source: https://techxplore.com/news/2020-09-battery-free-game-boy.html 498893 A prototype developed by researchers at ...

GD32L233C-START Development Board Evaluation 2: GD32L233C Chip Low Power Performance Test 1

GD32L233C-START Development Board Evaluation 2 : GD32L233C chip low power performance test 1. Preparation before testing ...

Salt spray test chamber: revealing the truth about tire corrosion testing

  With the development of the automobile industry and the continuous improvement of safety awareness, the quality and ...

What are the job prospects for web and big data?

Web Development: With the rapid development of the Internet and information technology, Web development has become a hot ...

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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