|
|
View previous topic :: View next topic |
Author |
Message |
philippe320
Joined: 30 Dec 2005 Posts: 11
|
Incompatibility between HID bootloader and CCS USB routines |
Posted: Fri Nov 14, 2008 10:51 am |
|
|
Hello everybody,
Here is my code :
Code: |
//set to 1 to use a PIC's internal USB Peripheral
//set to 0 to use a National USBN960x peripheral
#define __USB_PIC_PERIF__ 1
#if !defined(__PCH__)
#error USB CDC Library requires PIC18
#endif
#include <18F2550.h>
#build(reset=0x1000)
#build(interrupt=0x1008)
#org 0,0x0FFF void bootloader() {} // nothing will replace the bootloader memory space
#fuses USBDIV,PLL5,CPUDIV2,HSPLL
#fuses NOIESO,NOFCMEN,NOWRT
#fuses VREGEN,BORV20,NOBROWNOUT,NOPUT
#fuses NOWDT,WDT32768,CCP2C1
#fuses NOPBADEN,NOLPT1OSC,MCLR
#fuses NODEBUG,STVREN,NOLVP,NOXINST
#use delay(clock=48000000)
#include <usb_cdc.h>
void Init_PIC();
void Blinking();
/////////////////////////////////////////////////////////////////////////////
//
// Configure the demonstration I/O
//
/////////////////////////////////////////////////////////////////////////////
#define LED_ON output_high
#define LED_OFF output_low
#define LED_TOGGLE output_toggle
#define TSOP PIN_B7
#define LED_bleue PIN_B6
//___________________________________________________
void main(void) {
Init_PIC();
// 2 blinkings;
Blinking();
Blinking();
while (TRUE) {
if (!input(TSOP)) LED_ON(LED_bleue);
else LED_OFF(LED_bleue);
} //while
} //main
//___________________________________________________
void Init_PIC() {
LED_OFF(LED_bleue);
} //proc
//___________________________________________________
void Blinking() {
LED_ON(LED_bleue);
delay_ms(100);
LED_OFF(LED_bleue);
delay_ms(900);
} //proc
|
When simply flashed into the PIC, it's working perfectly :
the LED is blinking twice, and the accordingly the TSOP input (remote control receiver)
But when using the HID bootloader from Microchip modified for the 18F2550, I have some problems :
without the line
Code: |
#include <usb_cdc.h>
|
it's still working
but WITH that line, the PIC hangs (very fast LED blinking then nothing)
What kind of conflict could I have?
Thanks in advance for your reply
Philippe |
|
|
Ttelmah Guest
|
|
Posted: Fri Nov 14, 2008 3:51 pm |
|
|
Obvious question is how the interrupt redirection is handled in the bootloader.
Best Wishes |
|
|
philippe320
Joined: 30 Dec 2005 Posts: 11
|
|
Posted: Sun Nov 16, 2008 4:28 am |
|
|
YES !
very very strange :
after many and many tests, I reinstalled CCS, and thus the USB files, recompiled everything and ...
IT'S WORKING !
(I probably modified something the the usb drivers files ...)
thank you Ttelmah for your reply
Philippe |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|