找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

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

快速入門msp430fr6989之八位7段數(shù)碼管顯示

[復制鏈接]
ID:590721 發(fā)表于 2019-7-27 20:07 | 顯示全部樓層 |閱讀模式
【注】本人用的是8個顯示位的7段數(shù)碼管,有八個控制位,控制位低電平有效,段碼位低電平有效。首先第一個程序是控制單個數(shù)碼管,用引腳位的電平控制顯示數(shù)字1。第二個程序是通過段位碼控制兩個或者以上的輪流顯示數(shù)字。

MSP430FR6989
The MSP430FR6989 is the next device in TI's new ULP FRAM technology platform. FRAM is a cutting
edge memory technology, combining the best features of flash and RAM into one nonvolatile memory.
Device features include:
• 1.8-V to 3.6-V operation
• 16-bit RISC architecture up to 16-MHz system clock and 8-MHz FRAM access
• 128KB of nonvolatile FRAM
• 100 µA/MHz active mode and 350 nA standby with RTC and 3.7-pF crystal
• Certified ULPBench score of 109
• 320-segment LCD controller
• Extended Scan Interface
• 16-channel 12-bit ADC
• Comparator
• Five Timers
• Direct memory access
• 256-bit AES
這是官網(wǎng)給出的部分資料,由于用的數(shù)碼管需要高電平5v左右的電平才會無效,但是板子的電平控制最高在1.8-3.6V,所以無法失效。介意以后的新手買低電平有效的控制位。
段位碼很簡單,網(wǎng)上查找一下。

單片機源程序如下:
  1. #include "msp430fr6989.h"
  2. #include <stdint.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include "seg_led.h"
  6. #include "delay.h"


  7. unsigned char seg_num[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98};
  8. /**********************
  9. 設置Init_PORT_seg_led(void):設置數(shù)碼管的IO端口
  10. **********************/
  11. void Init_PORT_seg_led(void){
  12.   P9DIR = 0xFF;//P9口設置為輸出
  13.   P1DIR |= BIT3;
  14.   P1OUT |= BIT3;//設置P1.3為高電平可以選擇此通道
  15.   
  16. }
  17. void seg_show1(void){
  18.   Init_PORT_seg_led();
  19.   while(1){
  20.     delay(100);
  21.     P9OUT = 0xF9;//為輸出低電平有效
  22.    
  23.   }
  24. }
復制代碼

全部資料51hei下載地址:
快速入門msp430fr6989之八位7段數(shù)碼管.7z (286.66 KB, 下載次數(shù): 10)

評分

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

查看全部評分

回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

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

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

快速回復 返回頂部 返回列表