
Originally Posted by
kam42
2) Does that unique code allow separate Teensy's to show up as different and persistent COM ports?
On Windows, the driver uses the USB serial number to map otherwise-the-same devices to COM port numbers.
If you're using a blank MK20 chip, the serial number should be 4294967295 on every board. The serial number is initialized by this code in usb_desc.h:
Code:
void usb_init_serialnumber(void)
{
char buf[11];
uint32_t i, num;
__disable_irq();
FTFL_FSTAT = FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL;
FTFL_FCCOB0 = 0x41;
FTFL_FCCOB1 = 15;
FTFL_FSTAT = FTFL_FSTAT_CCIF;
while (!(FTFL_FSTAT & FTFL_FSTAT_CCIF)) ; // wait
num = *(uint32_t *)&FTFL_FCCOB7;
__enable_irq();
ultoa(num, buf, 10);
for (i=0; i<10; i++) {
char c = buf[i];
if (!c) break;
usb_string_serial_number_default.wString[i] = c;
}
usb_string_serial_number_default.bLength = i * 2 + 2;
}
You can experiment with different serial numbers, without touching the "program once" memory, by simply editing that code in usb_desc.c.