• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   2 Anonymous Users






Re: 在 33f 上使用 spi
#3
版主
版主


查看用戶資訊
在使用 dsPIC33F128MC804 的 SPI 界面之前,你一定要先看一下 dsPIC33FJ Reference Manual 裡的 Section 18. Serial Peripheral Interface (SPI) (上官網找一下就有)。
裡面有一暫存器 SPI1CON1 一定要看輕一定要看清楚他的設定方式。
其中 MSTEN: Master Mode Enable bit是設定:
1 = Master mode
0 = Slave mode


還有兩個位元 : SMP & CKE 是設定 SPI 的 Mode 的:

SMP: SPIx Data Input Sample Phase bit
Master mode:
1 = Input data sampled at end of data output time
0 = Input data sampled at middle of data output time
Slave mode:
SMP must be cleared when SPIx is used in Slave mode

CKE: SPIx Clock Edge Select bit(1)
1 = Serial output data changes on transition from active clock state to Idle clock state (refer to bit 6)
0 = Serial output data changes on transition from Idle clock state to active clock state (refer to bit 6)

有關 SPI 的參考範例可以參考底下的教育訓練裡的 SPI 章節,至少你要清楚你的 SPI Slave 是設定再哪一種 Mode 下,否則 Mode 設錯會出一些意想不到的問題的:
http://www.microchip.com.tw/modules/w ... glefile.php?cid=4&lid=229

發表於: 2010/1/28 9:51
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 在 33f 上使用 spi
#2
新會員
新會員


查看用戶資訊
没用过你这一款芯片,但是就我之前用过的SPI来说,是没有什么寄存器来设置SLAVE的,一般芯片对master支持的比较好,但是对于slave却要靠你来设计流程,简单来说clk上的时钟时钟都是由master来产生的,master发数据时,clk自动产生,这个时候的slave由于接收到时钟,所以开始接收数据,而slave要返回数据的时候也要靠master发送时钟,此时你可以让master发送类似0xFF的数据用来产生时钟,再让master对捕捉到的输入数据进行分析,提取有用的数据。

發表於: 2010/1/26 17:13
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


在 33f 上使用 spi
#1
新會員
新會員


查看用戶資訊
小弟想用 dsPIC33FJ128MC804 經 spi 介面去獲取 加速度传感器 ADIS16209 的數據, port RB12 為 SDI1, port RB11 為 SDO1, port RB13 為 SCK1, mcu 為 spi master, adis16209 為 spi slave

可是, 如何設定 adis16209 為 slave 呢? 希望各位幫忙!

發表於: 2010/1/25 19:30
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------