|
|
|
USB SPI Development
|
|
Date: 2007/06/12 08:51
|
By: JohnL
|
Status: Visitor
|
|
|
|
|
|
|
Hi
I'm developing using the USB setup using an 18F4550 using a 20MHz xtal, to run a number of SPI devices. I have both the USB and SPI running in seperate programs to ensure their operation, however, when I merge the programs and extend the command set in user.c, when I access any SPI commands, teh device locks up and is no longer recognised as a USB device - one of the LEDs flashes rapidly.
I have simplified the code, only writing one byte on the SPI - added to one of teh existing command codes, and the device still ocks up. Is there something I might be missing - does the SPI module have any impact on the operation of the USB module in the PIC.
Your help would be appreciated.
Thanks
JohnL
|
|
|
|
|
Re:USB SPI Development
|
|
Date: 2007/06/23 07:51
|
By: dariog
|
Status: User
|
|
|
Karma: 6  
|
|
| Posts: 107 |   | |
|
Only problem I can see (and have faced too, but using software SPI) is that you may "hang" in the SPI routines for too long (due to clock, or polling flags...), thus causing USB to disconnect. USBTasks() must be called every 50-100 uS on average.
|
|
|
|