atmega8 Example: FLASH version 5110

Publisher:科技徜徉Latest update time:2016-12-29 Source: eefocusKeywords:atmega8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Today I tried to store the array in flash and then read it out, and I made some modifications to the original 5110 project. Can you tell where I changed it?

 

uint8 Chinese_Font[][25]PROGMEM =   
{  
  /*-- Text: 兀 --*/  
  /*-- Kaiti 9; The corresponding dot matrix under this font is: width x height = 12x12 --*/  
  /*-- The height is not a multiple of 8, now adjusted to: width x height = 12x16 --*/  
  {  
    0x00,0x48,0x48,0xDE,0xFE,0xF4,0xFE,0x76,0x24,0x04,0x04,0x00,0x00,0x02,0x03,0x03,  
  0x01,0x03,0x03,0x02,0x02,0x02,0x03,0x00  
  },  
  
//Omit other definitions



Two files need to be modified:


/****************************************************** ********** 
** Name: void LCD_Write_Char(uint8 c) 
** Function: Write a character 
** Input parameter: c character to be written 
** Export parameters: None 
** Instructions for use: None 
*************************************************** **********/   
void LCD_Write_Char(uint8 c)  
{  
    uint8 line = 0;  
      
    c -= 32;  
      
    for (line = 0; line < 6; line++)  
    {  
        LCD_Write_Byte(pgm_read_byte(&ASSIC_Font[c][line]), 1);  
    }  
}


 


/****************************************************** ********** 
** Name: void LCD_Write_Chinese_String(uint8 X, uint8 Y,uint8 ch_with, 
** uint8 num,uint8 s[][],uint8 line,uint8 row) 
** Function: Write Chinese sentences to the specified coordinates 
** Input parameters: X, Y coordinates of settings 
** ch_with The width of Chinese characters 
** num The number of Chinese characters 
** s array 
** line starts from which line 
** row The width between words 
** Export parameters: None 
** Instructions for use: None 
*************************************************** **********/  
void LCD_Write_Chinese_String(uint8 X, uint8 Y,uint8 ch_with,  
                              uint8 num,uint8 s[][],uint8 line,uint8 row)  
{  
    uint8 i = 0;  
    uint8 n = 0;  
    uint8 (*catch)[25] = s;  
  
    LCD_Set_XY(X,Y);                              
    /*Write string*/  
    for (i = 0;i < num;)  
    {  
        for (n = 0; n < ch_with * 2; n++)                
        {   
            if (n == ch_with)                       
            {  
                if (i == 0)   
                {  
                    LCD_Set_XY(X,Y + 1);  
                }  
                else  
                {  
                    LCD_Set_XY((X + (ch_with + row) *i),Y + 1);  
                }  
            }  
            //Read data from flash  
            LCD_Write_Byte(pgm_read_byte(&catch[line + i][n] ),1);  
        }  
        i++;  
        LCD_Set_XY((X + (ch_with + row) * i),Y);  
    }  
}


Keywords:atmega8 Reference address:atmega8 Example: FLASH version 5110

Previous article:IAR defines variables into registers "__regvar"
Next article:Use of atmega8 Flash

Recommended ReadingLatest update time:2024-11-24 19:54

ATMEGA8 SPI bus read and write 93C46
// PIN assignment  #define SS PB2 //Chip select  #define SCK PB5 //cLOCk  #define MOSI PB3 //input  #define MISO PB4 //output  #define SS_SET (PORTB|=(1 SS))  #define SCK_SET (PORTB|=(1 SCK))  #define MOSI_SET (PORTB|=(1 MOSI))  #define SS_CLR (PORTB &= ~(1 SS))  #define SCK_CLR (PORTB &= ~(1 SCK))  #define MOSI_CLR (
[Microcontroller]
Sine wave inverter power supply based on ATmega8 microcontroller control
  In the wind power industry, it is often necessary to repair wind turbines in the field, and various repair tools and instruments must be powered. Therefore, it is necessary to design a portable, low-power, intelligent sinusoidal inverter power supply to power these devices, which can greatly improve the efficiency o
[Power Management]
Sine wave inverter power supply based on ATmega8 microcontroller control
ATmega8 clock selection fuse settings
The following content is translated from the English manual of mega8. I hope it will be helpful to everyone. If you find any errors, please correct them. mega8 fuses: 1: Not programmed (not selected) 0: Programmed (selected) ******************************** Fuse Description Default Setting ***********************
[Microcontroller]
Design of infrared blind-guiding system controlled by ATmega8 microcontroller
    In order to help the blind group guide the blind more conveniently, an infrared blind guide system controlled by a single-chip microcomputer is designed. The ATmega8 single-chip microcomputer is used as the control core, and the infrared distance sensor GP2Y0A02YK0F based on the PSD principle is selected. The sing
[Microcontroller]
Design of infrared blind-guiding system controlled by ATmega8 microcontroller
Design of intelligent management system for electric vehicle battery based on ATmega8
Abstract : Based on the ATmega8 microcontroller, this paper designs a distributed, modular electric vehicle battery management system that communicates via the LIN bus and has intelligent charging functions, which realizes the effective monitoring and management of multiple battery groups. Keywords :
[Microcontroller]
Design of intelligent management system for electric vehicle battery based on ATmega8
Digital power amplifier design based on Atmega8
1 Introduction Digital power amplifiers are increasingly used in real life due to their high efficiency and easy connection with digital audio sources. It mainly consists of two parts. Figure 1 is the basic block diagram of the digital power amplifier. There are roughly two types of PWM transformations. One is analo
[Microcontroller]
atmega8 routine: INT1 external interrupt
/***********************************************************  * Function library description: ATMEGE8 INT1 interrupt program                          * Version: v1.0                                                                                           *                                                              
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号