【注】本人用的是8個顯示位的7段數碼管,有八個控制位,控制位低電平有效,段碼位低電平有效。首先第一個程序是控制單個數碼管,用引腳位的電平控制顯示數字1。第二個程序是通過段位碼控制兩個或者以上的輪流顯示數字。
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
這是官網給出的部分資料,由于用的數碼管需要高電平5v左右的電平才會無效,但是板子的電平控制最高在1.8-3.6V,所以無法失效。介意以后的新手買低電平有效的控制位。
段位碼很簡單,網上查找一下。
單片機源程序如下:
- #include "msp430fr6989.h"
- #include <stdint.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include "seg_led.h"
- #include "delay.h"
- unsigned char seg_num[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98};
- /**********************
- 設置Init_PORT_seg_led(void):設置數碼管的IO端口
- **********************/
- void Init_PORT_seg_led(void){
- P9DIR = 0xFF;//P9口設置為輸出
- P1DIR |= BIT3;
- P1OUT |= BIT3;//設置P1.3為高電平可以選擇此通道
-
- }
- void seg_show1(void){
- Init_PORT_seg_led();
- while(1){
- delay(100);
- P9OUT = 0xF9;//為輸出低電平有效
-
- }
- }
復制代碼
全部資料51hei下載地址:
快速入門msp430fr6989之八位7段數碼管.7z
(286.66 KB, 下載次數: 10)
2019-7-28 02:46 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|