Help with USB Serial on an 18F4550
Posted: Thu Jun 08, 2017 7:35 pm
Hi, I realize that USB Slave is currently not working in V7, but is the USB serial component stable? Here's what I'm trying to do in a separate simple test case:
I've basically replicated the LED blink program in a loop (turn <any> port bit on, add a delay, turn same port bit back off, add another delay). My delays are both 100 uS. The program works as expected and my pulse widths are correct.
Now, if I add the USB_Serial component to my project, everything still works fine. But, if I drag and drop the "USB_Serial::Initialise" macro to the top of my program (yes, outside the loop) and run it, both my negative and positive pulse widths are no longer stable. They randomly vary between ~106 (expected) up to 122 or so. If I disable the Initialise, the signal goes back to being stable again. Likewise, if leave in the Initialise, but simply remove the USB cable, they also go back to being stable.
I've tried both 4Mhz and 16Mhz oscillators with no change. Problem is, I need both USB connectivity and the stable GPIO pulse widths for my project. The PW variances are causing random misreads on my other port bits due to the mistiming. Maybe there's something I'm overlooking.
Thanks
I've basically replicated the LED blink program in a loop (turn <any> port bit on, add a delay, turn same port bit back off, add another delay). My delays are both 100 uS. The program works as expected and my pulse widths are correct.
Now, if I add the USB_Serial component to my project, everything still works fine. But, if I drag and drop the "USB_Serial::Initialise" macro to the top of my program (yes, outside the loop) and run it, both my negative and positive pulse widths are no longer stable. They randomly vary between ~106 (expected) up to 122 or so. If I disable the Initialise, the signal goes back to being stable again. Likewise, if leave in the Initialise, but simply remove the USB cable, they also go back to being stable.
I've tried both 4Mhz and 16Mhz oscillators with no change. Problem is, I need both USB connectivity and the stable GPIO pulse widths for my project. The PW variances are causing random misreads on my other port bits due to the mistiming. Maybe there's something I'm overlooking.
Thanks