找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 3142|回復(fù): 0
收起左側(cè)

STM8讀取Flash_eeprom程序

[復(fù)制鏈接]
ID:301293 發(fā)表于 2018-5-29 10:03 | 顯示全部樓層 |閱讀模式
STM8讀取Flash_eeprom單片機(jī)源程序如下:
  1. /******************** (C) COPYRIGHT  風(fēng)馳iCreate嵌入式開發(fā)工作室 ********************
  2. * 文件名  :main.c
  3. * 描述    :Flash_eeprom讀寫實(shí)驗(yàn)   
  4. * 實(shí)驗(yàn)平臺(tái):iCreate STM8開發(fā)板
  5. * 庫(kù)版本  :V2.0.0
  6. * 作者    :ling_guansheng
  7. **********************************************************************************/

  8. /* Includes ------------------------------------------------------------------*/
  9. /* Includes ------------------------------------------------------------------*/
  10. #include "stm8s.h"
  11. #include "stm8s_clk.h"
  12. #include "intrinsics.h"
  13. #include "stm8s_uart1.h"
  14. #include "uart.h"
  15. #include "flash_eeprom.h"

  16. void Delay(u16 nCount);


  17. /* Private defines -----------------------------------------------------------*/
  18. /* Private function prototypes -----------------------------------------------*/
  19. /* Private functions ---------------------------------------------------------*/

  20. int main(void)
  21. {

  22.   /* Infinite loop */
  23.   
  24.   /*設(shè)置內(nèi)部時(shí)鐘16M為主時(shí)鐘*/

  25.     Flash_eeprom_readwrite_Init();
  26.    /*!<Set High speed internal clock  */
  27.     CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
  28.     Uart_Init();
  29.     Flash_eeprom_readwrite_Test();
  30.     Flash_eeprom_Erase_Test();
  31.    
  32.    __enable_interrupt();

  33.    while (1);
  34. }

  35. void Delay(u16 nCount)
  36. {
  37.   /* Decrement nCount value */
  38.   while (nCount != 0)
  39.   {
  40.     nCount--;
  41.   }
  42. }



  43. #ifdef USE_FULL_ASSERT

  44. /**
  45.   * @brief  Reports the name of the source file and the source line number
  46.   *   where the assert_param error has occurred.
  47.   * @param file: pointer to the source file name
  48.   * @param line: assert_param error line source number
  49.   * @retval : None
  50.   */
  51. void assert_failed(u8* file, u32 line)
  52. {
  53.   /* User can add his own implementation to report the file name and line number,
  54. ……………………

  55. …………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼

所有資料51hei提供下載:
STM8Flash_eeprom.rar (246.27 KB, 下載次數(shù): 41)


評(píng)分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評(píng)分

回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表