|
回復 1# AdamQ
>>我想請問:
>>1. 在程式的開頭SPCR、SPE、MSTR、SPSR、SPDR、clr....etc 皆沒有被定義,
>>若照結果來推測,SPE與MSTR應該是6與4,
>>我的說法對嗎? 若是的話這些數值是預先被定義在哪呢?
An SPI library is now included in the Arduino software.
The Arudiuno will not have SPI enabled unless I load a sketch / library which sets the SPRC register and enables SPI, correct? If I load a sketch which uses SPI will those changes remain when the Arduino reboots. Lets say I change sketch to "Blink", will the SPCR still be set to enabled?
If I enable SPI by making the appropriate changes to the registers. What would I need to clear all of these SPI settings?
>>2. 如果我想在SPCR裡寫入上述的指令,
>>我可以直接將程式碼改為 : SPCR=B01010000嗎?
你可以試試看,行就行,不行就不行,反正程式碼怎麼規格寫,都是隨創作者高興作的, |
|