音影先锋亚洲天堂网|电影世界尽头的爱完整版播放|国产 熟女 91|高清无码免费观看欧美日韩|韩国一区二区三区黄色录像|美女亚洲加勒比在线|亚洲综合网 开心五月|7x成人在线入口|成人网站免费日韩毛片区|国产黄片?一级?二级?三级

登錄 免費注冊 首頁 | 行業(yè)黑名單 | 幫助
維庫電子市場網(wǎng)
技術交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術 | 電源技術 | 測控之家 | EMC技術 | ARM技術 | EDA技術 | PCB技術 | 嵌入式系統(tǒng)
驅動編程 | 集成電路 | 器件替換 | 模擬技術 | 新手園地 | 單 片 機 | DSP技術 | MCU技術 | IC 設計 | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe

DSPIC30f系列單片機人機對話LCD,LED,UART等源碼

作者:二月之窗 欄目:單片機
DSPIC30f系列單片機人機對話LCD,LED,UART等源碼

本人長期從事電源設計,在DSPIC30f應用上也走過很多彎路,特提供原碼一份,給弟弟妹妹們.祝福早日成功!
/*;------------------------------------------------------------------------------
; UART-PC DISPLAY routines for Lab 4 and 5
;------------------------------------------------------------------------------
*/
        #include <p30f6011.h>
        #include "UART_DISPLAY.h"

//;Initialize UART PORT to communicate with the PC for DISPLAY

void UART_DISPLAY_Setup(void){
        U1MODE = 0xA000;     // Enable UART, 8 bits, 1 stop, no parity
        U1STA = 0x8400;     // Enable transmitter, RECEIVER, normal modes
        U1BRG = (unsigned int)(((unsigned LONG)OSCILLATOR/(16*(unsigned LONG)BAUD_RATE))-1);
        }

/* ;------------------------------------------------------------------------------
;Write array contents to PC through UART
*/

void UART_DISPLAY(unsigned int num_bytes,int *array_ptr[]){
        unsigned int i = 0, k;
        unsigned CHAR j;
//        UART_PutChar(0);                    // Send out start of packet delimiter
//        UART_PutChar(num_bytes);            // Send out the NUMBER of bytes in the array
//        UART_PutChar(num_bytes>>8);
        while(i < num_bytes){
            j = (unsigned CHAR)array_ptr[i++];
            if(j == 0)
                j = 1;
            UART_PutChar(j);
            }
        k = 12500;
        while(k--);                    // Delay for 50 mS
        }

void UART_PutChar(unsigned CHAR i){
    while(U1STAbits.UTXBF);        // Spin LOCK waiting for buffer to be empty
    U1TXREG = i;                // Send CHARacter
    }
;*************************************************************8
/*;------------------------------------------------------------------------------
; LCD DISPLAY routines for Lab 5/6
;------------------------------------------------------------------------------
*/
        #include <p30f6014a2.h>
        #include "LCD_DISPLAY.h"

//;Initialize SPI PORT to communicate with the LCD DISPLAY

void LCD_DISPLAY_Setup(void){
        LATGbits.LATG9 = 1;     // Set SPI slave SELECT pin high
        TRISGbits.TRISG9 = 0;    // and set as OUTPUT
        SPI2CON = 0x003c;        // Load SPI CONTROL register with MASTER mode, Clk = Fosc/64, Input data sampled at middle of OUTPUT time, Data cLOCKed out on rising edge, Clk idle is low
        SPI2STAT = 0x8000;         // Enable SPI PORT
        }

/* ;------------------------------------------------------------------------------
;Clear a column at X=W10 of the DISPLAY
*/

void LCD_DISPLAY_ClrCol(unsigned CHAR x){
        unsigned CHAR counter;
        counter = 32;            // Load counter to clear pixel 32 times
        while(counter > 0){
        LCD_DISPLAY_Byte(0xd9);        // Load command to clear a pixel, Call routine to send the command to the DISPLAY
        LCD_DISPLAY_Byte(x);         // Load X location of pixel, Call routine to send the command to the DISPLAY
        LCD_DISPLAY_Byte(counter--);     // Load Y location of pixel, Call routine to send the command to the DISPLAY
        }
}
        
/* ;------------------------------------------------------------------------------
;DISPLAY a pixel at X=W10 and Y=W11
*/

void LCD_DISPLAY_Pixel(unsigned CHAR x,unsigned CHAR y){
        LCD_DISPLAY_Byte(0xd8);        // Load command to set a pixel, Call routine to send the command to the DISPLAY
        LCD_DISPLAY_Byte(x);        // Load X location of pixel, Call routine to send the command to the DISPLAY
        LCD_DISPLAY_Byte(y);        // Load Y location of pixel, Call routine to send the command to the DISPLAY
        }

/* ;------------------------------------------------------------------------------
;Send W0 byte to LCD
*/

void LCD_DISPLAY_Byte(unsigned CHAR VALUE){
        unsigned int junk;
        LATGbits.LATG9 = 1;        // Set slave SELECT high
        LATGbits.LATG9 = 0;        // Set slave SELECT low for new transmission
        junk = SPI2BUF;            // Read buffer to avoid overflow
        SPI2BUF = VALUE;        // Write the data to the OUTPUT buffer
        while(!SPI2STATbits.SPIRBF); // Check if transmission complete
        }

void LCD_DISPLAY_array(int *array_ptr[]){
    unsigned CHAR j,k;
    for (k=0; k<122; k++)
               {
               j = (unsigned CHAR)array_ptr[k]/8;
           &nb
2樓: >>參與討論
chencj13
做過逆變電源嗎?
 
3樓: >>參與討論
violit
好同志。!堅決頂起!!
我也在學dspic

4樓: >>參與討論
二月之窗
回復 PIC
我就是做電源的
用過2010做光伏逆變。有一論文發(fā)表!

5樓: >>參與討論
zhouyh
你的代碼很好,正學DSPIC30F能發(fā)一份到ZSE-MAIL@163.COM嗎?先謝謝
 
6樓: >>參與討論
querli_wjh
謝謝
能不能發(fā)一份到我的信箱:querli_wjh@163.com

7樓: >>參與討論
ymy
雷鋒同志
雷鋒同志

8樓: >>參與討論
liu131365
給我一份吧,3X
多謝了,我也在搞dspic30f

xiaomingge@gmail.com




9樓: >>參與討論
crazykid
也給我一份吧
發(fā)給我一份好嗎,謝謝啦!
ckxmd@126.com

10樓: >>參與討論
zzhong_hy
也給我一份學習學習
樓主,給我一份學習學習,zzhong_hy@163.com

11樓: >>參與討論
powerking
二月大俠請發(fā)份代碼給我吧
好好學習
tonyliu168@163.com

* - 本貼最后修改時間:2006-6-6 10:35:48 修改者:powerking

12樓: >>參與討論
TROYE
我也想要,好好學習一下

我也想要一份好好學習一下

liuzhidongcn@163.com

多謝!

13樓: >>參與討論
PeterAmy
也發(fā)給我一份吧,謝謝
qiuiahua5599@sohu.com

14樓: >>參與討論
tech116
各位,要隔離電源可別忘了我啊,部分隔離電源上傳。
現(xiàn)貨庫存,全新原裝,價格優(yōu)惠!
聯(lián)系方式:0755-21166981    ggxx123@tom.com   高勛
型號如下:
定電壓輸入、定電壓雙輸出,功率1W, 隔離電壓1000VDC, SIP7封裝。
A0303S-1W     A0305S-1W    A0309S-1W    A0312S-1W    A0315S-1W   A0318S-1W   A0324S-1W
A0503S-1W     A0505S-1W    A0509S-1W    A0512S-1W    A0515S-1W   A0518S-1W   A0524S-1W
A0903S-1W     A0905S-1W    A0909S-1W    A0912S-1W    A0915S-1W   A0918S-1W   A0924S-1W
A1203S-1W     A1205S-1W    A1209S-1W    A1212S-1W    A1215S-1W   A1218S-1W   A1224S-1W
A1503S-1W     A1505S-1W    A1509S-1W    A1512S-1W    A1515S-1W   A1518S-1W   A1524S-1W
A1803S-1W     A1805S-1W    A1809S-1W    A1812S-1W    A1815S-1W   A1818S-1W   A1824S-1W
A2403S-1W     A2405S-1W    A2409S-1W    A2412S-1W    A2415S-1W   A2418S-1W   A2424S-1W

定電壓輸入、定電壓雙輸出,功率2W, 隔離電壓1000VDC, SIP7封裝。
A0303S-2W     A0305S-2W    A0309S-2W    A0312S-2W    A0315S-2W   A0318S-2W   A0324S-2W
A0503S-2W     A0505S-2W    A0509S-2W    A0512S-2W    A0515S-2W   A0518S-2W   A0524S-2W
A0903S-2W     A0905S-2W    A0909S-2W    A0912S-2W    A0915S-2W   A0918S-2W   A0924S-2W
A1203S-2W     A1205S-2W    A1209S-2W    A1212S-2W    A1215S-2W   A1218S-2W   A1224S-2W
A1503S-2W     A1505S-2W    A1509S-2W    A1512S-2W    A1515S-2W   A1518S-2W   A1524S-2W
A1803S-2W     A1805S-2W    A1809S-2W    A1812S-2W    A1815S-2W   A1818S-2W   A1824S-2W
A2403S-2W     A2405S-2W    A2409S-2W    A2412S-2W    A2415S-2W   A2418S-2W   A2424S-2W

定電壓輸入、定電壓雙輸出,功率3W, 隔離電壓1000VDC, SIP8封裝。
A0303S-3W     A0305S-3W    A0309S-3W    A0312S-3W    A0315S-3W   A0318S-3W   A0324S-3W
A0503S-3W     A0505S-3W    A0509S-3W    A0512S-3W    A0515S-3W   A0518S-3W   A0524S-3W
A0903S-3W     A0905S-3W    A0909S-3W    A0912S-3W    A0915S-3W   A0918S-3W   A0924S-3W
A1203S-3W     A1205S-3W    A1209S-3W    A1212S-3W    A1215S-3W   A1218S-3W   A1224S-3W
A1503S-3W     A1505S-3W    A1509S-3W    A1512S-3W    A1515S-3W   A1518S-3W   A1524S-3W
A1803S-3W     A1805S-3W    A1809S-3W    A1812S-3W    A1815S-3W   A1818S-3W   A1824S-3W
A2403S-3W     A2405S-3W    A2409S-3W    A2412S-3W    A2415S-3W   A2418S-3W   A2424S-3W

定電壓輸入、定電壓雙輸出,功率5W, 隔離電壓1000VDC, SIP8封裝。
A0303S-5W     A0305S-5W    A0309S-5W    A0312S-5W    A0315S-5W   A0318S-5W   A0324S-5W
A0503S-5W     A0505S-5W    A0509S-5W    A0512S-5W    A0515S-5W   A0518S-5W   A0524S-5W
A0903S-5W     A0905S-5W    A0909S-5W    A0912S-5W    A0915S-5W   A0918S-5W   A0924S-5W
A1203S-5W     A1205S-5W    A1209S-5W    A1212S-5W    A1215S-5W   A1218S-5W   A1224S-5W
A1503S-5W     A1505S-5W    A1509S-5W    A1512S-5W    A1515S-5W   A1518S-5W   A1524S-5W
A1803S-5W     A1805S-5W    A1809S-5W    A1812S-5W    A1815S-5W   A1818S-5W   A1824S-5W
A2403S-5W     A2405S-5W    A2409S-5W    A2412S-5W    A2415S-5W   A2418S-5W   A2424S-5W


定電壓輸入、定電壓雙輸出,功率1W, 隔離電壓1000VDC, DIP14封裝。
A0303D-1W     A0305D-1W    A0309D-1W    A0312D-1W    A0315D-1W   A0318D-1W   A0324D-1W
A0503D-1W     A0505D-1W    A0509D-1W    A0512D-1W    A0515D-1W   A0518D-1W   A0524D-1W
A0903D-1W     A0905D-1W    A0909D-1W    A0912D-1W    A0915D-1W   A0918D-1W   A0924D-1W
A1203D-1W     A1205D-1W    A1209D-1W    A1212D-1W    A1215D-1W   A1218D-1W   A1224D-1W
A1503D-1W     A1505D-1W    A1509D-1W    A1512D-1W    A1515D-1W   A1518D-1W   A1524D-1W
A1803D-1W     A1805D-1W    A1809D-1W    A1812D-1W    A1815D-1W   A1818D-1W   A1824D-1W
A2403D-1W     A2405D-1W    A2409D-1W    A2412D-1W    A2415D-1W   A2418D-1W   A2424D-1W

定電壓輸入、定電壓雙輸出,功率2W, 隔離電壓1000VDC, DIP14封裝。
A0303D-2W     A0305D-2W    A0309D-2W    A0312D-2W    A0315D-2W   A0318D-2W   A0324D-2W
A0503D-2W &
15樓: >>參與討論
gaohaiyan
我對DSP很感興趣 ,目前正想學,能給我一份嗎?
mail:gaopetrel@163.com

16樓: >>參與討論
lh9865
如果可以的話,我也想要一份,謝謝了
mail:lh9865@sohu.com

17樓: >>參與討論
單片機電源
我對DSP很有興趣!能給我發(fā)一分嗎?多謝了。海
頂!頂!頂!
郵箱:quxiaofang2005@126.com

18樓: >>參與討論
thankw
謝謝可以給我一份嗎 --- thankw@sohu.com
謝謝,可以給我一份嗎?thankw@sohu.com

19樓: >>參與討論
yangzq
謝謝
郵箱:yzq2002cn2002@yahoo.com


20樓: >>參與討論
chjman
給我一份好嗎,謝謝!----chj119@sohu.com
 
21樓: >>參與討論
lsh001
剛開始接觸DSPIC30f,太需要了
請給我發(fā)一份,shunhua99@yahoo.com.cn

22樓: >>參與討論
yangzq
謝謝
謝謝

俺上邊的郵箱寫錯了,重來!給樓主添麻煩了。

郵箱:yzq2002cn@yahoo.com




23樓: >>參與討論
dbh7024
請發(fā)給我一份行么?
dbhfree@126.com

24樓: >>參與討論
kaxint
利害
沒有想世上還有這樣的好人

25樓: >>參與討論
yuwen037
也給我一份吧,51轉PIC真的感覺很不容易呀,謝了
也給我一份吧,換工作了,將51轉PIC真的感覺很不容易呀,謝了
郵箱:g_yuwen_037@163.com

26樓: >>參與討論
lizhe1024
謝謝了,我也想要一份!··
我剛接觸DSPIC30F系列!不是很了解!我想問一下想讓DSPIC30F5011單片機CAN通訊,怎么辦啊!我用KPCI-8110光隔非智能CAN總線通訊卡連82c250can收發(fā)器,再連單片機!

27樓: >>參與討論
5518604
雷鋒無私奉獻啊,值得學習
頂起,給我一份吧,先謝啦

28樓: >>參與討論
haozhengzh
求取代碼
你好:
     我最近也在學習dsPIC,苦于沒有找到合適的例子,今天看到你這個代碼非常的高興,如果可以的話,給我也發(fā)一份。在這謝謝了

29樓: >>參與討論
zxl8103
好東東,置頂!
正在尋求原碼,太感謝了,能發(fā)給我一份嗎?

30樓: >>參與討論
tt163
好東西  能發(fā)一份給我嗎?hftt163@163.com
好東西
能發(fā)一份給我嗎?hftt163@163.com
thanks

31樓: >>參與討論
li3
謝謝,請發(fā)一份.
 
32樓: >>參與討論
wxwxian
也給我一份吧
 
33樓: >>參與討論
youhu520
兄弟!你太好拉!給我一份好嗎?
兄弟!
很高興能看到你的留言.
我是一個剛從學校畢業(yè)的
我現(xiàn)在在深圳
找到工作不久.
也是從事電源這一塊的
我想你的這份資料能對我學習和提高自己有很大的幫助.
能給我一份好嗎?


34樓: >>參與討論
ylc1108
謝謝可以給我一份嗎? --ylc1108@yahoo.com.tw
謝謝可以給我一份嗎? --ylc1108@yahoo.com.tw

35樓: >>參與討論
dianji002
兄弟,先謝謝你了,給我傳一份好吧
 
36樓: >>參與討論
gwf_mcu
兄弟傳給我一份吧,gwf1981sohu.com
兄弟傳給我一份吧,gwf1981@sohu.com謝謝了,我很需要真是雪中送碳呀

37樓: >>參與討論
Troye
能給我一份嗎?
你好!
我剛準備開始用 DSPIC30F4013 ,上網(wǎng)找資料時看到了你的帖子。
能給我一份源碼嗎?

liuzhidongcn@163.com

多謝!

38樓: >>參與討論
schen568
好兄弟,給我一份,謝了
 
39樓: >>參與討論
haller246
高手給我一份
guoyanpeng123@yahoo.com.cn
頂了!。!

40樓: >>參與討論
二月之窗
我先在在混筆記
    我先在在混筆記
wind-solar.21ic.org
歡迎到我的新田地里討論新能源問題.里面我為大家準備很多珍貴的資料.
希望大家支持啊

41樓: >>參與討論
nike.com
我想要關于STC控制LED達到跑馬燈效果的程序
我想要關于STC控制LED達到跑馬燈效果的程序,謝謝。拜托。急。

42樓: >>參與討論
cathryn
我想要一份,謝謝,我的郵箱zhanglina0131@163.com
 
43樓: >>參與討論
sunskylu

能給我也發(fā)一份嗎??非常感謝。 

sunskylu@tom.com

44樓: >>參與討論
sunskylu

順便還想問一句,請問你有LCD_Display.h這個頭文件不?能不能麻煩你把它也給我那?非常感謝哦!

sunskylu@tom.com

參與討論
昵稱:
討論內容:
 
 
相關帖子
初學PIC
PIC單片機型號后綴帶4AP是啥意思?
關于PIC USB接口的問題
請教:16f88x的ra4內部結構
pic16f877aD的AD
免費注冊為維庫電子開發(fā)網(wǎng)會員,參與電子工程師社區(qū)討論,點此進入


Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號