Hey i have made a simple test program for USB communication. But I am experiencing some weird behavior that that I just cannot understand and was hoping someone here would know.
If I send 18 or more characters it works fine but if I send less I can’t see anything on the screen (the green LED is still blinking).
I am using a Terminal program to see the data. I have tried both Tera Term and Br@y Terminal.
this work
#include <wixel.h>
#include <usb.h>
#include <usb_com.h>
#include <stdio.h>
uint8 XDATA response[32];
void send() {
uint8 responseLength;
responseLength = sprintf(response, "abcdefghijklmn\r\n");
usbComTxSend(response, responseLength);
delayMs(40);
}
void main() {
systemInit();
usbInit();
while (1) {
boardService();
usbComService();
usbShowStatusWithGreenLed();
send();
}
}
this doesn’t
#include <wixel.h>
#include <usb.h>
#include <usb_com.h>
#include <stdio.h>
uint8 XDATA response[32];
void send() {
uint8 responseLength;
responseLength = sprintf(response, "abcdefghijklm\r\n");
usbComTxSend(response, responseLength);
delayMs(40);
}
void main() {
systemInit();
usbInit();
while (1) {
boardService();
usbComService();
usbShowStatusWithGreenLed();
send();
}
}