SPI範例問題
|
||||
---|---|---|---|---|
新會員
|
unsigned char SPI_ByteWrite(unsigned char SPI_DATA )
{ int Dummy ; SPI1BUF = SPI_DATA ; while ( ! IFS0bits.SPI1IF ) ; IFS0bits.SPI1IF = 0 ; for ( WaitLoop = 0 ; WaitLoop < 50 ; WaitLoop ++ ) ; return (unsigned char) SPI1BUF ; } 如上之程式,長時間測試會遇到while ( ! IFS0bits.SPI1IF ) ; 一直等不到 IFS0bits.SPI1IF =1 的時後會造成程式當在此行, 請問如何處理較好?
發表於: 2009/10/12 9:50
|
|||
|
RTCC一問
|
||||
---|---|---|---|---|
新會員
|
請問在MCU只作RTCC功能時除了進入SLEEP mode以外,還有那些方法可讓MCU耗電流降低?因為在此模式希望MCU耗電流小又能顯示RTCC資料.
將振盪器切換成RC,且MCU速度放慢是否可行 ?還是還有更好的方法?
發表於: 2009/3/23 16:53
|
|||
|
Re: 我用UART收GPS資料會停住,一個個敲字不會 ??
|
||||
---|---|---|---|---|
新會員
|
在使用PIC 的UART 時須注意,最好在主迴圈定時去檢查UART的錯誤旗標,有發生就必須用軟體清除,否則在實驗室測試可能沒有問題,當量產到客戶端你可能會收到GPS時鐘不會動,定不到衛星訊號等等問題,而一直怪罪GPS,卻不知是自己的MCU UART已
crash......
發表於: 2009/3/20 18:44
|
|||
|
Re: 24FJ64GA004 I2C errata
|
||||
---|---|---|---|---|
新會員
|
我用24FJ128GA008在相同的I2C code 就無bus 碰撞問題,我不知24FJ64GA004 系列在I2C介面到底能用否?板子都洗下去了,
發表於: 2008/10/13 20:01
|
|||
|
24FJ64GA004 I2C errata
|
||||
---|---|---|---|---|
新會員
|
在 errata 中提到使用I2C1須軟硬體修正,我改了之後可正常working,但隔天軟件沒改硬件也沒動,但bus collision卻又一直發生了,有人跟我遇到相同問題嗎?要如何解決24FJ64GA004 I2C1的電容效應?
我RB9一開始已設成OutPut,且清為0 在SDA1也加一顆C 下地 In Master mode, this error may cause a bus collision to occur instead of a Start bit transmission. Transmissions after the SDA1 pin has been held low will occur correctly. Work around Using an external device or another I/O pin from the microcontroller, drive the SDA1 pin low. If no external devices or additional I/O pins are available, it is sometimes possible to perform the work around internally, using the following steps: • With the module in Master mode, configure the RB9 pin as an output; • Clear the LATB9 bit (for the default I2C1 assignment) or LATB5 (for the alternate I2C1 assignment) to drive the pin low; • Enable I2C1 by setting the I2CEN bit (I2C1CON<15>). Note that this action could appear to be a Start bit to an I2C slave device on the bus if the RB8/SCL1 pin is not driven low prior to driving RB9/SDA1 low. It may be necessary to add additional capacitance to the SDA1 bus in order to maintain the low logic level long enough for the module to detect the low logic level. Make sure that when adding capacitance, that the application does not violate the I2C timing specifications.
發表於: 2008/10/10 12:39
Edited by chingjau on 2008年10月10日 13:10:39
|
|||
|
Re: C30 VARIABLE TO BE PLACED IN PROGRAM MEMORY
|
||||
---|---|---|---|---|
新會員
|
sir:
針對data 放在ram 是這樣寫,但存在ROM 好像不是,user guide 有如下說明 The MPLAB C30 compiler does not directly support accessing variables in program space. Variables so allocated must be explicitly accessed by the programmer, usually using table-access inline assembly instructions, or using the program space visibility window 但我不知如何coding
發表於: 2008/9/26 15:48
|
|||
|
C30 VARIABLE TO BE PLACED IN PROGRAM MEMORY
|
||||
---|---|---|---|---|
新會員
|
請問16bit MCU,若陣列資料存在program memory,如下
const __attribute__((space(auto_psv))) char my_const_array[10] = "Help"; 語法如何宣告將此my_const_array陣列指標傳至另一函數 及如何取出此陣列長度和陣列每個位置資料?
發表於: 2008/9/26 11:02
|
|||
|
Re: 請問誰有用過PIC在real-time OS方面的應用??
|
||||
---|---|---|---|---|
新會員
|
上網搜尋PICOS18網站 免費的real time OS
發表於: 2007/9/19 8:50
|
|||
|
請問版主
|
||||
---|---|---|---|---|
新會員
|
UART的 error flag (FERR and OERR)
是要在中斷服務程式清除 or 主迴圈main()去清除
發表於: 2007/6/14 17:07
|
|||
|