• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
:::

論壇索引


Board index » All Posts




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


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: PICKIT4 無法debug
新會員
新會員


Darren您好,

了解,今天會將PICKIT4寄出到代理商(華豫寧)那裏,代理商會幫忙轉寄,
謝謝您的回覆~~

發表於: 2022/4/12 16:12
頂部


Re: 接收串列傳輸數據
高級會員
高級會員


對,我想問Bit排列寫入的方法,是類似下面這樣,把數值依序放入a0~a7這樣
ByteValue1就可以直接提取16進制的數值嗎?
struct ByteValue1
{
unsigned a0 : 1 ;
unsigned a1 : 1 ;
unsigned a2 : 1 ;
unsigned a3 : 1 ;
unsigned a4 : 1 ;
unsigned a5 : 1 ;
unsigned a6 : 1 ;
unsigned a7 : 1 ;
};
另一個問題是我想用每次CLK觸發時,用迴圈填入數據,但是bit形式的陣列是怎麼宣告呢?
if(j<23)
{a[ j ] = Data;}
else
j = 0;
沒找到這類範例的關鍵字,厚顏來請各位老哥提點:D

發表於: 2022/4/12 16:11
頂部


Re: PICKIT4 無法debug
管理員
管理員


s3618504 您好

PICKit 4 送修時間約三個月至半年(需寄送美國維修)

送修資訊如下:
收件人:CAE-Darren 收
地址:10491台北市中山區民權東路三段4號12樓
電話:02 2508 8225

PS.請附上您的姓名、地址、電話,一併與PICKit4寄出
謝謝

發表於: 2022/4/12 15:23
頂部


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


24bit = 3bytes, 那不就是用3bytes存就好,何需char tb[23] 這個23bytes的陣列呢?還是我有誤會?

發表於: 2022/4/12 15:02
頂部


Re: PICKIT4 無法debug
新會員
新會員


KevinLu 您好,

我已經有更換USB傳輸線並使用
"Hardware Tool Emergency Firmware Boot Recovery Utility"回復原廠設定,進入debug mode時還是會出現下面訊息

Reception on endpoint 129 failed (err = -10121)
Reception on endpoint 129 failed (err = -10121)
A communication error with the debug tool has occurred. The tool will attempt to recover momentarily.

Unable to run the target device.
Transmission on endpoint 2 failed (err = -10121)

請問可以送修嗎?

手上有PICKIT3進入debug mode是沒有問題的!!

發表於: 2022/4/12 11:40
頂部


接收串列傳輸數據
高級會員
高級會員


各位好, 小弟想用PIC16LF1823接收一組24個bit的串列數據,數據是一個20bit的數值,後4位是符號位。
目前是用char tb[23]陣列儲存起來,但要加總時就變得相當麻煩,想問看看該怎麼簡化呢?

發表於: 2022/4/12 10:04
頂部


Re: CAN BUS問題
中級會員
中級會員


你好
都是不同ID

發表於: 2022/4/9 9:23
頂部


Re: X IDE 編譯時間超久??
資深會員
資深會員


設定heap 2048 還是會時好時壞

找到microchip的解決方案
https://microchipsupport.force.com/s/a ... X-freezes-or-is-very-slow

Attach file:


Link only for registered users

發表於: 2022/4/8 23:11
頂部


Re: X IDE 編譯時間超久??
資深會員
資深會員


依網路解答 heap 設 2048 就好很多了...

Attach file:



jpg  Image 017.jpg (107.24 KB)
546_62500abfecd38.jpg 1124X482 px

發表於: 2022/4/8 18:13
頂部



« 1 ... 81 82 83 (84) 85 86 87 ... 7525 »



:::

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

教育訓練中心

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