• slider image 442
  • slider image 497
  • slider image 498
  • slider image 499
  • slider image 500
  • slider image 502
:::


Browsing this Thread:   1 Anonymous Users






Re: 關於EEPROM的SPI傳輸範例
#6
版主
版主


查看用戶資訊
PML1986,

請問你要用哪一顆 SPI EEPROM? 送幾個資料出去是跟 SPI EEPROM 有關,不是隨意送出去的他是需依據 SPI eeprom 的規格需求。

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


Re: 關於EEPROM的SPI傳輸範例
#5
資深會員
資深會員


查看用戶資訊
參照:

PML1986 寫道:
感謝版大的解惑

想在請教
如果我只想傳8bits的位址
是否只用SPI_ByteWrite ( SPI_Addr )只用這樣形式就可以達到
例如:ADDRESS=0x002C

還是一樣要分成高低位元用移位和邏輯運算送資料??


你把SPI_ByteWrite ( (SPI_Addr >> 8) & 0x00ff );
MARK掉 看看 如果可以正常寫入 就好了
....大部分 位址的長度 取決於IC的容量大小 如果TOTAL ADDR沒超過256個位置因該都還好

又或者直接把SPI_Addr define成0x002C看看

二分法 很快就可以試出來了

發表於: 2010/1/21 9:43
My name is jan,Jan是棒的
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於EEPROM的SPI傳輸範例
#4
資深會員
資深會員


查看用戶資訊
要送幾個byte是在EEPROM的規格(跟EEPROM size有關).
你要自己看spec

跟你要"讀/寫"那一個位址是無關的.

板主舉例:
>>SPI 一次送出 8-bit,所以 25LC256 之類的 EEPROM 需 16-bit 位址

自己看spec囉!!!

發表於: 2010/1/21 9:41

Edited by Ryang on 2010年01月22日 17:10:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於EEPROM的SPI傳輸範例
#3
高級會員
高級會員


查看用戶資訊
感謝版大的解惑

想在請教
如果我只想傳8bits的位址
是否只用SPI_ByteWrite ( SPI_Addr )只用這樣形式就可以達到
例如:ADDRESS=0x002C

還是一樣要分成高低位元用移位和邏輯運算送資料??

發表於: 2010/1/21 8:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於EEPROM的SPI傳輸範例
#2
版主
版主


查看用戶資訊
SPI 一次送出 8-bit,所以 25LC256 之類的 EEPROM 需 16-bit 位址,所以 16-bit address 要先送 MSB 再送 LSB 資料。

發表於: 2010/1/20 17:42

Edited by Ryang on 2010年01月22日 17:09:11
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於EEPROM的SPI傳輸範例
#1
高級會員
高級會員


查看用戶資訊
各位先進 您好

小弟在日前研讀EEPROM的SPI傳輸'程式範例


對於下列這幾行程式有些疑問

SPI_CS = 0 ;

SPI_ByteWrite ( SPI_EE_WRITE ) ;
SPI_ByteWrite ( (SPI_Addr >> 8) & 0x00ff );
SPI_ByteWrite ( SPI_Addr & 0x00ff ) ;
SPI_ByteWrite ( SPI_Data ) ;
SPI_CS = 1 ;

看不太懂SPI_Addr 為何要先位移8bits在和0xff作and邏輯運算

此用意為何??
有先進知道
SPI_ByteWrite ( (SPI_Addr >> 8) & 0x00ff );
SPI_ByteWrite ( SPI_Addr & 0x00ff ) ;
這兩行的程式動作為何嗎

很抱歉 新手上路 問題很多

發表於: 2010/1/20 16:35
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... ]

教育訓練中心

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