• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::

論壇索引


Board index » All Posts (linwangco)




Re: 接收串列傳輸數據
#1
資深會員
資深會員


struct _BITS_32
{
unsigned char bit00: 1;
unsigned char bit01: 1;
unsigned char bit02: 1;
unsigned char bit03: 1;
unsigned char bit04: 1;
unsigned char bit05: 1;
unsigned char bit06: 1;
unsigned char bit07: 1;
unsigned char bit08: 1;
unsigned char bit09: 1;
unsigned char bit10: 1;
unsigned char bit11: 1;
unsigned char bit12: 1;
unsigned char bit13: 1;
unsigned char bit14: 1;
unsigned char bit15: 1;
unsigned char bit16: 1;
unsigned char bit17: 1;
unsigned char bit18: 1;
unsigned char bit19: 1;
unsigned char bit20: 1;
unsigned char bit21: 1;
unsigned char bit22: 1;
unsigned char bit23: 1;
unsigned char reserved: 8;

};

typedef union
{
unsigned long AllMsg;
struct _BITS_32 bits;
}BITS_32;

BITS_32 tb;
void test(void)
{
unsigned long Alldata;
unsigned char i;
unsigned char cn;//收到的資料

//用這樣收集資料聚集起來,從hi bit開始收
for(i=0;i<23;i++)
{
Alldata = (Alldata << 1) | (cn & 0x01);
}

//用這樣收集資料聚集起來,從low bit開始收
for(i=0;i<23;i++)
{
Alldata = Alldata | ( (cn & 0x01) << i );
}

//最後如果要讀取一個bit的資料
tb.AllMsg = Alldata;
cn = tb.bits.bit00 ; //類似這樣就可以讀取bit0資料
}

以上請參考

發表於: 2022/4/13 10:13
除役的胖子FAE
頂部


Re: PIC18F4685 UART Baud rate
#2
資深會員
資深會員


把表格看完
只有圖中的右下角那個設定可以達到115200
但是ERROR RATE高達 2.12%
不建議使用

我認為你可以把fosc往上提升速度。

Attach file:



jpg  (0.00 KB)


發表於: 2020/6/16 10:02
頂部


Re: 有沒有人有PIC32MX Uart DMA的應用範例
#3
資深會員
資深會員


我是直接參考 PIC32 Family Reference Manual, Sect. 31 DMA Controller,裡面就有sample code,拿出來弄一弄就會動了。

http://ww1.microchip.com/downloads/en/DeviceDoc/60001117H.pdf

發表於: 2020/5/29 10:33
頂部


Re: 程式執行時,暫存器被清除的問題
#4
資深會員
資深會員


試著把結構的宣告成const
宣告成const 就是常數,程式運行中不會被更改。
不過建議你還是查出哪裡會把它清為0,使用Ryang建議的方法去找。


宣告常數結構類似這樣
const struct
{
unsigned char PA;
unsigned char PB;
}parameter ={1,2};

以上,請參考。

發表於: 2020/5/28 15:24
頂部


Re: 程式執行時,暫存器被清除的問題
#5
資深會員
資深會員


你的111那張圖上面框的全部變數都是0
2222那張圖 上面的框全部變數也都是0
旁觀者如何知道你的程式碼
是如何把這些全部清為0

一頭霧水中

發表於: 2020/5/28 14:47
頂部


Re: MPLAB X IDE include問題
#6
資深會員
資深會員


我也是常常出現一堆紅色黃色波浪
後來我是改專案的編碼
就正常了。

不知道對你的專案有沒有用
可以試試看。

Attach file:



jpg  (0.00 KB)


發表於: 2020/5/27 16:33
頂部


Re: struct編譯正確但卻出現 unable to resolve identifier
#7
資深會員
資深會員


把bit 改成 bits

應該就可以了吧。

發表於: 2020/5/27 16:23
頂部


Re: Debug Mode觀看變數
資深會員
資深會員



發表於: 2019/3/13 10:38
頂部



(1) 2 3 4 ... 29 »



:::

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... ]

教育訓練中心

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