Dynamic USB Serial Number (PIC18F4550)


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply Darrel.

    I can see how assigning a serial number on the PC side could overcome this problem but you have to admit its a bit of a bodge and if you end up having to keep a lookup table of handle to serial number then a software crash would lose that information and you would have un-plug and then reattach your devices to re-assign serial numbers - very clunky! For a one off application this might be OK however this device is likely to be used in many different pieces of software in the future and minimising the PC side coding is very desirable.

    When you say overwriting the flash and re-enumerating is not worth it which part is not worth it? if its the re-enumerating can I not just write over the flash before calling USBINIT? Or is writing to the flash the hard part?

    Thanks

    Andy

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Sure, you could just write the PORTD value to flash on power-up (if it changed). Then when the device connects to the PC ... it will have the new S/N.

    But yes ... writing the string to flash IS the hard part, and that would limit you to 256 devices (globally).

    Some programmers will allow you to save an incrementing S/N to flash on each program cycle. The meLabs programmer let's you do that. But finding the correct location in flash to put the data is the hard part there. If the program changes, the string location will too.

    It's a tough one.
    <br>
    DT

  3. #3
    Join Date
    Jul 2009
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    OK, I failed to realise that the location in flash will change (although it does make sense now I think about it).

    Limiting to 256 devices is no problem, there will never be that many in existence.

    I think what I shall do is revert to an earlier version of my firmware that uses an extra byte in the USB Transfers to identify the device.

    Thanks for the help Darrel.

Similar Threads

  1. Serial data to USB
    By cooksydesign in forum USB
    Replies: 18
    Last Post: - 29th October 2008, 16:10
  2. USB and serial cable connection(s)
    By ardhuru in forum Schematics
    Replies: 3
    Last Post: - 18th August 2008, 16:26
  3. USB Serial Communication Continuous
    By pic-ker in forum USB
    Replies: 16
    Last Post: - 14th February 2007, 13:27
  4. Bafo USB to serial adapter
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th July 2006, 19:48
  5. Serial to USB converter
    By jrt4fun in forum USB
    Replies: 6
    Last Post: - 8th August 2005, 16:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts