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

論壇索引


Board index » All Posts




Re: c語言內使用組合語言的問題?
初級會員
初級會員


喔~~~是這樣呀!也就是說無法直接使用位元變數囉。
謝謝~~

發表於: 2004/12/28 13:05
頂部


Re: 請教各位
版主
版主


改一下程式:
for (n=0; n<=count; n++)

發表於: 2004/12/28 10:22
頂部


Re: c語言內使用組合語言的問題?
管理員
管理員


Dear Customer,

在 HITECH C 中, bit variable was defined as an absolute *8+offset address and converted by HITECH C automatically.

例如 定義以下兩個變數時 , 在 .map 檔將看到 0x101 & 0x102 為其位址

bit TestBit1
bit TestBit2

---------------------------------------------------------------------
若我們先宣告一變數, 再用 bsf or bcf 來設定某位元的值 :

unsigned char Testvar ;

main( )
{
.....
#asm
bsf _TestVar1,1
#endasm

}

Best Regards,

發表於: 2004/12/28 10:07
頂部


請教各位
初級會員
初級會員


請教各位高手,這是我第一次使用HI-TECH的PICC18,下麵是我的一段delay程式,為什么無論我怎么改變變量的值,髮現delay的時間沒有變化啊,請各位大大給我指點,謝謝!!!
void delay (unsigned long count)
{unsigned long n;
for(n=0;n++;n<=count)
{asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");}
}

發表於: 2004/12/28 9:37
頂部


Re: 可以分享利用外部中斷來計數encode的程式嗎
高級會員
高級會員


encode有機械式和光耦合各有不同請問要哪一種啊
介意C言嗎?

發表於: 2004/12/28 9:35
頂部


Re: 燒錄後怪怪ㄉ!
版主
版主


建議先用 Debugger Mode 讓程式執行無誤後再用Programmer Mode 燒成 Stand Alone Mode 單機執行。

Programmer Mode 無法除錯,如何確定程式沒錯呢!

發表於: 2004/12/28 9:28
頂部


c語言內使用組合語言的問題?
初級會員
初級會員


我使用hitech-c,在c中宣告的位元變數是否可以與組合共用:
bit abc;
.
.
.
#asm
bsf _abc
.
.
.
#endasm

這樣compiler時會出現錯誤訊息。~~還是不是這樣用??

發表於: 2004/12/28 8:19
頂部


Re: 燒錄後怪怪ㄉ!
高級會員
高級會員


版主你說的兩種模式我大概了解...
一種是Debugger...
一種是Programmer...
Debugger模式燒錄完...
好像不能將ICD2拔掉...
我所要的是燒錄完後能把ICD2拔掉!
所以我用的是Programmer模式...
這模式我用很久ㄌ...
都沒啥問題!!!

發表於: 2004/12/27 21:50
頂部


Re: 燒錄後怪怪ㄉ!
版主
版主


ICD2 有兩種燒錄方式; 看起來你是用到 Programer 的選項燒成 Stand Alone Mode, 切回Debugger Mode再燒錄吧!

你應該會得到下列的 Loading DebugExecutive 的項目的。

MPLAB ICD 2 Ready
Programming Target...
...Erasing Part
...Programming Programming Executive
...Verifying Programming Executive
...Programming Program Memory (0x0 - 0x1FF)
Verifying...
...Program Memory
...Verify Succeeded
...Loading DebugExecutive
...Programming DebugExecutive
...Debug Executive
...Programming Debug Vector
...Debug Vector
...Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
Connecting to debug executive
...Programming succeeded
MPLAB ICD 2 Ready

發表於: 2004/12/27 17:58
頂部


Re: 燒錄後怪怪ㄉ!
高級會員
高級會員


版主你好...
我的意思是指我使用同一個程式...
之前燒錄,執行都沒問題...
今天重做就不行了!!
版主你說"有問題應該是程式上有bug所在"??
雖然我不是很懂這句話的意思...
但我是使用同一個程式...
程式上應該不會有問題(我沒改過)!
只是現在在燒錄時...
多了這些文字...
我記得之前燒錄好像沒這些文字出現..
所以我對這些文字感到有些疑惑?!
既然版主說這些文字沒什ㄇ問題...
那問題可能是出在別的地方吧!!
努力尋找中....
另外有關Configure Bits...
我不知道版主想知道哪些設定..
我列幾個比較重要的!
Oscillator...HS
Osc. Switch Enable....Disabled
Power Up Timer....Disabled
Brown Out Detect....Disabled
Watchdog Postscaler....Disabled-Controlled by SWDTEN bit
Low Voltage Program....Disabled

發表於: 2004/12/27 17:34
頂部



« 1 ... 7297 7298 7299 (7300) 7301 7302 7303 ... 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... ]

教育訓練中心

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