USB serial PIC18F2455 compile warning
Posted: Wed Dec 07, 2016 3:15 pm
Hi,
Some questions about USBserial ...
1. Compiler give warning message:
Employing 18F2455 errata work-arounds:
* Corrupted fast interrupt shadow registers
. . .
ENC28J60_Example3.c: FCD_056e1_USB_Serial1__ReadByte()
902: return (FCR_RETVAL);
^ (345) unreachable code (warning)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2. USBserial cant initialize without connection to PC. Main loop will run only after USB is connected to PC. It is OK?
I think, USB serial is not a first priority device... For example, if USB serial is used only for debugging or device configuration, device need to be started without usb connection, but usb need to be ready for hot connection of PC. What solution may be good for this?
3. attached example contain a 1sec flasher made by TMR0 interrupt, and once per second usb serial send "connection check" text to pc. It works ok. When webserver receive GET command, usbserial must send to terminal message "get received". In real hardware after message "get received" usb will crash. Main loop works, led blinks, web page works, but 1sec test messages and GET messages not working.
Usb start working again only after usb cable disconnecting and terminal program restarting. Is it any bug or my wrong code?
Thanks!
Some questions about USBserial ...
1. Compiler give warning message:
Employing 18F2455 errata work-arounds:
* Corrupted fast interrupt shadow registers
. . .
ENC28J60_Example3.c: FCD_056e1_USB_Serial1__ReadByte()
902: return (FCR_RETVAL);
^ (345) unreachable code (warning)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2. USBserial cant initialize without connection to PC. Main loop will run only after USB is connected to PC. It is OK?
I think, USB serial is not a first priority device... For example, if USB serial is used only for debugging or device configuration, device need to be started without usb connection, but usb need to be ready for hot connection of PC. What solution may be good for this?
3. attached example contain a 1sec flasher made by TMR0 interrupt, and once per second usb serial send "connection check" text to pc. It works ok. When webserver receive GET command, usbserial must send to terminal message "get received". In real hardware after message "get received" usb will crash. Main loop works, led blinks, web page works, but 1sec test messages and GET messages not working.
Usb start working again only after usb cable disconnecting and terminal program restarting. Is it any bug or my wrong code?
Thanks!