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


Browsing this Thread:   1 Anonymous Users






Re: PIC18F4550 USB(HID)與UART 的問題!!
#7
新會員
新會員


查看用戶資訊
Truseme,
HID 還是需要driver 的只是OS已經內含而已!!
還有確定一下你的是HID device 沒有含別的裝置!!

發表於: 2008/9/19 11:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC18F4550 USB(HID)與UART 的問題!!
#6
新會員
新會員


查看用戶資訊
請教各位大大!!
为什么用proteus 仿真PIC18F4550 USB(HID)时候总是显示要驱动.HID不是不要驱动的吗!

發表於: 2008/9/7 9:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC18F4550 USB(HID)與UART 的問題!!
#5
新會員
新會員


查看用戶資訊
Thanks for calvin,
問題已解決!
我本身有兩個問題!(實際上的PIC是4553)
1. 在Proteus 上模擬不需要usb_bus_sense
所以我在實際的板子上忘了做這個!!
2. 就是中斷的問題了!!
謝囉!

發表於: 2008/8/28 11:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC18F4550 USB(HID)與UART 的問題!!
#4
管理員
管理員


查看用戶資訊
你好,

可能的原因是 USB 原先設定的 Interrupt Priority 為 High , 所以如果你 Enable 中斷後會因為我們的 F/W 未使用中斷處理 USB . 所以會有問題:)

我的做法如下 :
1. 將 CPU 的優先式中斷 Enable.
2. 將 USB 的優先等級設為 Low
3. 將 UART 的優先設 High
4. Disable 低優先中斷
RCONbits.IPEN ;            //    Enable Priority interrupt type !!
        
IPR2bits.USBIP ;        //     Set USBIF as Low priority interrupt 
        
INTCON2bits.RBIP ;        //    Set RBIP as low priority interrupt
        
IPR1bits.RCIP ;            //     Set RCIF as High priority interrupt 
        
IPR1bits.TXIP ;

        
INTCONbits.GIEH ;
        
INTCONbits.GIEL ;

發表於: 2008/8/25 11:38
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC18F4550 USB(HID)與UART 的問題!!
#3
新會員
新會員


查看用戶資訊
先謝謝囉!!
我目前的解法是HID device 可以上, PC to PIC18 UART 可以動但是就是PIC18 要傳data給PC 會有問題!!

發表於: 2008/8/22 23:35
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC18F4550 USB(HID)與UART 的問題!!
#2
版主
版主


查看用戶資訊
這問題還是要找 Calvin Ho 來回答,但是他現在在南台科大上 16-bit 精英般的課,要到下週才會進辦公室。我會通知他的。 

發表於: 2008/8/22 8:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PIC18F4550 USB(HID)與UART 的問題!!
#1
新會員
新會員


查看用戶資訊
請教各位大大!!
最近小弟用4550裝載USB(HID)device時, 因為有用到high priority 中斷去傳輸和接收uart的資料!
奇怪的是在proteus模擬的時候都是正常工作!!
實際上到板子卻是不行動作!
MPLAB v8.1 c18 v3.14

//--------有問題的部分code-----
extern void _startup (void); // See c018i.c in your C18 compiler dir
#pragma code _RESET_INTERRUPT_VECTOR = 0x000800
void _reset(void)
{
_asm goto _startup _endasm
}
#pragma code _LOW_INTERRUPT_VECTOR=0x18
void _low_ISR(void)
{
_asm GOTO PIC18F_Low_isr _endasm
}

#pragma code _HIGH_INTERRUPT_VECTOR=0x8
void _high_ISR(void)
{
_asm GOTO PIC18F_High_isr _endasm
}
#pragma code

#pragma interrupt PIC18F_High_isr
void PIC18F_High_isr(void)
{
if(PIR1bits.TXIF==1){
PIR1bits.TXIF=0;
TransCtr++;
if(TransCtr==(TransSize)){
TXSTAbits.TXEN=0;
FLAGbits.TxFlag=0;
}
else if(TransCtr<TransSize){
if(TransCtr==(TransSize-1)){
TransBuf[(TransSize-1)]=TransChksum;
TXREG=TransBuf[(TransSize-1)];
}
else{
TXREG=TransBuf[TransCtr];
TransChksum+=TransBuf[TransCtr];
}
}
}
//--------------------------------------------
void main(void)
{
/*****************************************/
Init_UART();
RCONbits.IPEN=1; INTCONbits.GIEH = 1;
INTCONbits.GIEL = 1;
INTCONbits.PEIE = 1;
/**************************************/
while(1){
//USBTasks(); // USB Tasks

}
目前查到的現象是!!
1. disable USBTasks() UART 正常工作!!
2. 在proteus 看不到問題工作都正常!!
請問大大!!
這是否是USBTasks()一直在動作影響中斷得執行!!

發表於: 2008/8/20 14:17
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

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

教育訓練中心

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