1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
//***********************************************************************************************************
// File Function: N76E003 APROM program DATAFLASH as EEPROM way //*********************************************************************************************************** #include "N76E003.h" #include "Common.h" #include "Delay.h" #include "SFR_Macro.h" #include "Function_define.h" #define ADDR_BASE 0x4700 #define FLASH_L_LOW ADDR_BASE+1 #define FLASH_L_HIGH ADDR_BASE+2 #define FLASH_H_LOW ADDR_BASE+3 #define FLASH_H_HIGH ADDR_BASE+4 volatile unsigned char xdata page_buffer[128]; UINT8 Read_APROM_BYTE(UINT16 code *u16_addr) { UINT8 rdata; rdata = *u16_addr>>8; return rdata; } *u16_addr>>8;为什么要右移的? |
|
相关推荐
1个回答
|
|
The shift right by 8 bits (>>) is used to obtain the high byte of the data stored in the flash memory. In this specific code, it is used to read the data from the EEPROM (which is emulated using the flash memory of the N76E003 controller), since it is stored in a word (2-byte) format with the high byte stored first followed by the low byte. Therefore, shifting right by 8 bits will get the high byte of the data and shifting left by 8 bits will get the low byte of the data.
|
|
|
|
只有小组成员才能发言,加入小组>>
3314 浏览 9 评论
2995 浏览 16 评论
3494 浏览 1 评论
9059 浏览 16 评论
4088 浏览 18 评论
1178浏览 3评论
605浏览 2评论
const uint16_t Tab[10]={0}; const uint16_t *p; p = Tab;//报错是怎么回事?
599浏览 2评论
用NUC131单片机UART3作为打印口,但printf没有输出东西是什么原因?
2335浏览 2评论
NUC980DK61YC启动随机性出现Err-DDR是为什么?
1896浏览 2评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 09:05 , Processed in 1.128150 second(s), Total 80, Slave 61 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号