Topic History of: Basic USB - Using Microchip Stack and C#.Net Max. showing the last posts - (Last post first)
| Cristhian |
i've been trying to implement a Timer1 interrupt, but when i activate the interrupt the USB port have problems, can anyone helpme?
The problem ocurr in the USBTasks() function when the timer1 goes off, and the interrupt is activate
void UserInit(void)
{
.....
T1CON = 0b01000100;
PIR1bits.TMR1IF = 0; // Clear flag
TMR1H = TIMER1H_VAL;
TMR1L = TIMER1L_VAL; // Reinit timer value;
T1Cont=0;
PORTDbits.RD4=1;
INTCONbits.GIE=0;
INTCONbits.PEIE=1;
PIE1bits.TMR1IE=1; //Habilito interrupcion Timer1
T1CONbits.TMR1ON=1;
PIE2=0x00;
.....}
-------------------------------------------------------------------------------------
#pragma code _HIGH_INTERRUPT_VECTOR = 0x000808
void _high_ISR (void)
{
ProcessTMR1();
_asm retfie 0 _endasm;
}
--------------------------------------------------------------------------------------
void ProcessTMR1(void)
{
if(PIR1bits.TMR1IF == 1)
{
PIR1bits.TMR1IF = 0; // Clear flag
TMR1H = TIMER1H_VAL;
TMR1L = TIMER1L_VAL; // Reinit timer value;
T1Cont++;
if(T1Cont==Posicion){
LATDbits.LATD4=0;
//PORTDbits.RD4=0;
}
if(T1Cont>=400){
TMR1H = TIMER1H_VA1;
TMR1L = TIMER1L_VA1; // Reinit timer value;
}
if(T1Cont==404){
T1Cont =0;
LATDbits.LATD4=1;
//PORTDbits.RD4=1;
mLED_3_Toggle();
TMR1H = TIMER1H_VAL;
TMR1L = TIMER1L_VAL;
}
}
}//end ProcessTMR1 |
| USB Speed |
I understand Microchip provides a CDC usb driver that emulates a serial port and can go up to 115kbps (or 1mbps if really pushing it)...
You can also design with an HID driver, which is only about 64kbps.
Finally, if you write a custom driver, then I assume, you can do the full speed of USB1 or USB2.
What driver does this article use? |
| Arend |
I am knew to MPlab, so having some difficulties in setting all the paths.
I get the following error when building, all paths are set as stated in the start of this threat.
Debug build of project `C:picusbdemoMCHPUSB.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Mon Sep 29 01:27:58 2008
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Couldn't locate build tool. Check tool locations.
----------------------------------------------------------------------
Debug build of project `C:picusbdemoMCHPUSB.mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Mon Sep 29 01:27:58 2008
----------------------------------------------------------------------
BUILD FAILED |
| Jo |
Hi.. I need some help please..
I constructed the circuit as per the one shown in the diagram.
Compiling and programming was succesful.
When I tried to send command from C# either to add the numbers or to update the LED, the PIC is able to process the instruction only 1 time. After 1 time of processing the instruction, D2 and D3 (LED) will blink faster and faster alternately for few seconds and then both LEDs will go off.
I measure the Vusb and in normal condition, it will be 3.33V but after receiving the command from C# and processing it, it will go down to 0V.. I'm not sure whats the problem as I have followed the schematic.
Can somebody please advice.. Thanks. |
| Jaime |
Jon, Can you post your pic18f2450 code? |
| vishal patil |
Mat wrote:
Hey, it most likely you project build options are setup wrong, I'd recommend rechecking them.
There should look like this, (you'll have to change the library path to point to your appropiate directory),
Let me know how you get on.
Mat<br><br>Post edited by: mat, at: 2006/03/14 13:18 |
|