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

論壇索引


Board index » All Posts




想請問I2C應用範例
新會員
新會員


我有在範例程式那邊看到I2C的應用範例
可是因為是組語寫成的
請問有可能拿到c code 控制I2C的範例程式ㄇ
還有那是針對哪一個晶片所寫的

有I2C電路介面的PIC晶片目前台灣買的到ㄇ


發表於: 2005/8/3 23:23
頂部


請問要如何確定UART有接收到資料呢??
新會員
新會員


我用的方法是在Rx的interrupt裡寫一段程式如下:
void __attribute__((__interrupt__)) _U1RXInterrupt(void)
{
IFS0bits.U1RXIF = 0; // clear interrupt flag
TxIndex=0;
while (Txdata[TxIndex]) // do until NULL char is reached
{
WriteUART2((int)Txdata[TxIndex++]); //Call C peripheral library to transmit a character
while(BusyUART2()); // wait if transmitter is busy
}
}

就是當UART1接收到資料時,就用UART2在傳送出去另外一筆資料,
UART2傳送的程式也是驗證沒問題的,
但驗證結果卻是失敗的,
請問這表示我沒有收到資料嗎??
還是我的寫法不可行呢??

請高手們給個提示吧,
謝謝.....^^


發表於: 2005/8/3 22:20
頂部


Re: 也是 dsPIC c30 Encoder 的問題
管理員
管理員


已經寄給你了啦 !
很抱歉現在才看到 , 藉口是有一點忙啦 :)

發表於: 2005/8/3 21:55
頂部


Re: INT interrupt problem
管理員
管理員


Dear Customer,

Your program should works well if you are using PIC16F877A or other equivalent devices. The button connected to RB0 on PICDEM2 Plus is S3.

So, you will get INT0 interrupt if you press S3. You can set breakpoint at statement >> INTF=0 if you are debug your code by using MPLAB ICD2 or MPLAB ICE2000.

I copied your code and executed it , my program will stopped at INTF=0 if I pressed S3. Of course , breakpoint must be set.

Finally , you don't have to call InitINT( ) in your while(1) { .. } loop. you can move it to the next line of InitIO( ) .

Let us know if you still gain any problem during your code development.

Thanks & Best Regards,


發表於: 2005/8/3 21:51
頂部


Re: pic16f877問題請教
新會員
新會員


感謝您的回覆~
我是要將常數0x80~0x86存取到w暫存器,載來跟ad轉換的值相減,不過線在我卡在如何同時將上述七個常數同時存取呢?
movlw 0x80
movlw 0x81
movlw 0x82
movlw 0x83
movlw 0x84
movlw 0x85
movlw 0x86
subwf ad轉換的值 w
可以這樣寫嗎?
我是初學者,麻煩您囉!








發表於: 2005/8/3 21:20
頂部


Re: pic16f877問題請教
管理員
管理員



請問你是要將 Data Memory Address 0x80 ~ 0x85 的內容由 W 來存取 或是將常數值 0x80 ~ 0x85 寫入 W 呢 ?

若是要透過 W 存取 0x80 ~ 0x85 位址的 Data Memory :
>> BANKSEL 0x80
>> movf 0x80,W ( 寫入 W )
>> ( or ) movwf 0x80 ( 由 W 寫入 0x80 )

若是要將常數 0x80 寫入 W :
>> movlw 0x80 .....

祝你順利啦 !!

發表於: 2005/8/3 21:12
頂部


Re: PIC18FXX31
管理員
管理員


你好 ,

基本上 , PIC18F4431 可以直接放在 APP001 EVM Board 上做實驗. 但若您要測試 Motor Control PWM module 就要注意以下幾點了 :

1. PIC18F4431 的 PWM0 .. PWM5 在 PORTB 的 RB0..RB5. 所以要將 DSW2 做適當的調整.

2. PWM6 & 7 在 RD6 & RD7 , 要用到它們也要調整 DSW3.

3. QEI 的腳位 RA2..RA4 , 須要的話要調整 DSW1. ( LCD 的 E 腳使用 RA2 , 若被 QEI 用掉的話就不能驅動 LCD 了 )

使用 J1 ( 20X2 的 DIN COnnector, 在 CPU 右邊 ) 可以將信號外接.

Best Regards,

發表於: 2005/8/3 21:02
頂部


pic16f877問題請教
新會員
新會員


我現在想將0x80~0x85值存取到w暫存器,請問要如何撰寫呢?
我只知道若是c的話是寫0x80 to 0x85但組合語言要如何寫呢?
請各位高手提供點意見吧!!
感恩~~

發表於: 2005/8/3 20:18
頂部


INT interrupt problem
新會員
新會員


I met a problem:

I use PICDEM 2 PLUS and write a INT interrupt test routin as follows. But I cannot go into the interrupt routine. Please give me a hand. Thanks a lot.

# include <pic.h>

void InitIO (void);
void InitInt (void);
void interrupt Isr (void);

void main (void)
{
InitIO ();
while (1)
{
InitInt ();
if (RA4==0)
PORTB=0b00000010;
else
PORTB=0b00000100;
}
}


void InitIO (void)
{
PORTA=0x00;
ADCON1=0b00001110;
TRISA=0x11;
PORTB=0x00;
TRISB=0b11110001;
}

void InitInt (void)
{
INTEDG=0;
INTE=1;
GIE=1;
}

void interrupt Isr (void)
{
INTF=0;
PORTB=0b00001000;
}

發表於: 2005/8/3 18:09
頂部


PIC18FXX31
高級會員
高級會員


請問版主:PIC18FXX31適用於APP001的實習板嗎

發表於: 2005/8/3 17:52
頂部



« 1 ... 6986 6987 6988 (6989) 6990 6991 6992 ... 7522 »



:::

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

教育訓練中心

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