Re: 請問陣列範圍會超出嗎的問題?
|
||||
---|---|---|---|---|
管理員
|
如果是一個固定的圖檔時, 宣告為 const可以將這塊矩陣改放到Flash中減少SRAM的消耗,
其中因為宣告為常數const, 因此矩陣的 size 也必須是固定的常數, 不能是內容可變的計算式. #define BUF_SIZE 1024 const uint8_t buffer[BUF_SIZE] = {.....};
發表於: 2021/10/26 7:54
|
|||
|
Microchip CAE 空中教室 CryptoAuth 第二輪的課程, 將於今日(10/20) 的 3:00pm 開課
|
||||
---|---|---|---|---|
管理員
|
Micochip CAE 空中教室 CryptoAuthentication 課程 將於今日10/20 3:00pm~5:30pm 開課, 計兩個半小時的課程(中間休息10分鐘), 僅有一堂請勿錯過 ! 由於本課程須具備有一定的 密碼學概念 及 Harmony System Service/Driver的基礎 (SAM2002課程), 請學員預先學習及複習下面的教材及介紹, 將會讓您上課時更加融入講師的教授內容, (1) CryptoAuth 課程介紹 請點我 (2) CryptoAuth與SAM2002 課程教材 請點我 (3) Microchip University 密碼學入門(中文字幕80分鐘) 請點我 課程內容介紹: 課程名稱 : CryptoAuthentication 時間 : 2021/10/20(三) 3:00pm 主題 : (1) Cryptographic, Harmony CryptoAuthLib and Basic Communication (2) Symmertic/Asymmertic Authentication and Command Builder 講師 : Libra Chien (Microchip 台灣 CAE 團隊) 內容 : (1) Secure Embedded system and Cryptographic (2) CryptoAuthentication product Introduction (3) Harmony Configuration of CryptoAuth Library (4) System Service (TIME, CONSOLE and Command) (5) Usage of CryptoAuthLib (6) Chip Communication (7) Retrieval Chip Reversion and unique Serial Number (8) Random and Nonce command (9) Chip Provision (A) Symmetric Authentication, MAC (Message Authentication Code) (B) Asymmetric Authentication, GENKEY (ECC keypair generation) (C) Asymmetric Authentication, SIGN (ECDSA Sign operation) (D) Asymmetric Authentication, SIGN (ECDSA Verify operation) (E) Command and Response Package (F) Command Builder 教室 : [點我進入 CryptoAuth 課程] 課程開始 前10分鐘 至此處加入即可
發表於: 2021/10/20 8:53
|
|||
|
Re: MPLAB IDE 即時監控問題(dsPIC33CK using app041)
|
||||
---|---|---|---|---|
管理員
|
MPLAB X IDE 搭配燒錄除錯器時, 在 Debug 模式下可以添加斷點(Break Point), 來觀察程式的變數
當連接好燒錄除錯器時, 進入 Debug 模式只需點擊以下Icon即可進入, 接著你可以按滑鼠右鍵來新增 Watch 變數, 並在 Watches是視窗中觀察程式的變數 由於 Debug 的功能還蠻豐富的, 建議前往 Microchip University觀看下列影片, 可以快速幫您學習基本的除錯功能 MPLAB X IDE介紹(點我前往) 若您想要觀察即時的暫存器變數時, 則在 X IDE 的 Debug 模式下, 可以使用 SFRs(特殊功能暫存器)視窗來觀察, 當進入Debug模式之後, 點擊 Windw> Target Memory Views > SFRs 若程式中有設定斷點時, 則 Debug 會停在斷點處, 此時選擇 SFRs 視窗時, 可以看到當前的所有暫存器數值, 如果點選[Peripherals]可以將暫存器依照周邊來分類方便尋找 或是Debug時, 按下暫停鍵即可觀察當前程式執行位置的暫存器數值 當要繼續執行時, 就要按下撥放鍵 Attach file: XIDE_Debug1.jpg (67.58 KB) XIDE_Debug3.jpg (210.27 KB) XIDE_Debug4.jpg (277.20 KB) XIDE_Debug5.jpg (39.21 KB) XIDE_Debug6.jpg (43.18 KB) XIDE_Debug2.jpg (202.84 KB)
發表於: 2021/10/18 8:05
|
|||
|
Re: MPLAB X IDE 有辦法像 MPLAB IPE 一樣有 advanced mode 設定power 嗎
|
||||
---|---|---|---|---|
管理員
|
請先開啟一個專案設定好燒錄工具後在專案Properties中可以設定Power
順帶一提, 如果工具有支援Program To Go時, 在X-IDE中也可以直接將Project的HEX燒到Programmer中
發表於: 2021/10/14 14:09
|
|||
|
Re: 使用指標問題
|
||||
---|---|---|---|---|
管理員
|
可以估狗一下 "C 指標與多維陣列" 會有很多實用的範例與講解,
另外, Microchip University https://mu.microchip.com/ 也有專門教C語言的課程, 目前只有英文版, 中文版應該在年底前會翻譯好上架, 如果對於程式語言想要更了解的會員可以上去補習一下喔! (順便練一下英聽) 在開發環境與工具(英文版)分類中, 關於 C語言的相關課程有三門, 紅框中有您想學習的多維矩陣介紹, 下一個章節即為指標 https://mu.microchip.com/page/development-tools
發表於: 2021/10/13 7:52
|
|||
|
Re: 使用指標問題
|
||||
---|---|---|---|---|
管理員
|
由於您宣告下列兩個數值為 const char (常數 char *)
const char SADC1_GAIN_X1 [8] = {"SETADC10"}; const char GET_CSA_1 [8] = {"CURRENT1"}; 但是 function 卻是用 char *來接, 兩者型別不一致, void MultipleCMD_load(char *Mtemp1,char *Mtemp2) 1. 更改變數為 char* char SADC1_GAIN_X1 [8] = {"SETADC10"}; char GET_CSA_1 [8] = {"CURRENT1"}; 或是 2. 更改 function 的參數型態為 const char* void MultipleCMD_load(const char *Mtemp1, const char *Mtemp2) 另外, 矩陣名稱即為指標, 不用加 &, 加了應該會報錯 MultipleCMD_load(SADC1_GAIN_X1 , GET_CSA_1 ) ;
發表於: 2021/10/12 14:17
|
|||
|
Re: SAM2002 Lab driver 練習問題(SAMD21G17D)
|
||||
---|---|---|---|---|
管理員
|
這三個HANDLE放在一起宣告, 然後只有第三個錯誤嗎?
感覺上是打錯字或是沒有include sys_time 的 header file.
發表於: 2021/10/6 18:13
|
|||
|
Re: SAM2002 Lab driver 練習問題(SAMD21G17D)
|
||||
---|---|---|---|---|
管理員
|
改了SM2002 SPI1 OLED的Lab, 可以使用Driver實現 I2C(OLED+TempSensor+EEPROM+G-sensor), SPI(OLED) 由於I2C OLED原先採用 Two Byte transfer的方式實在是慢, [0x80] [Cmd Byte 0] , [0x80] [Cmd Byte 1] ... [0x80] [Cmd Byte n] , [0xC0] [Data Byte 0], [0xC0] [Data Byte 1], ... [0xC0] [Data Byte n], 建議改成連續Byte的操作方式(詳見SSD1306的Datasheet) // Bit 7 6 5 4 3 2 1 0 // Co D/C# 0 0 0 0 0 0 // Co : If the Co bit is set as logic “0”, the transmission of the following information will contain data bytes only. // D/C# : The D/C# bit determines the next data byte is a command or a data. // If the D/C# bit is set to logic “0”, it defines the following data byte as a command. // If the D/C# bit is set to logic “1”, it defines the following data byte as a data [0x00] [Cmd Byte 0] [Cmd Byte 1] ..... [Cmd Byte n] [0x40] [Data Byte 0] [Data Byte 1] ..... [Data Byte n] 我的I2C Driver Bus Write如下, 還是用Polling方式 避免Driver太晚處理到I2C Transfer Queue,
#define LCM_BUS_CMD 0x00
發表於: 2021/10/6 12:51
|
|||
|
Re: SAM2002 Lab driver 練習問題(SAMD21G17D)
|
||||
---|---|---|---|---|
管理員
|
由於OLED的Command與Data傳送時, 可能無法等到 Driver 去處理Queue中的 Transfer Request 完成, 建議用 Polling Status 方式來循序完成 OLED 的所有傳送需求,
1. 先拿掉TransferHandler
// DRV_I2C_TransferEventHandlerSet(drv_i2c_oled_handle, drv_i2c_oled_WriteHandler, 0);
2. Write 改成用Polling Status方式來做
void OLEDWrCmd(uint8_t command)
發表於: 2021/10/5 18:03
|
|||
|