{"id":13575387,"url":"https://github.com/dioannidis/usbasp","last_synced_at":"2025-04-04T22:31:02.947Z","repository":{"id":41066077,"uuid":"342612670","full_name":"dioannidis/usbasp","owner":"dioannidis","description":"usbasp improved firmware","archived":false,"fork":false,"pushed_at":"2024-08-05T14:42:24.000Z","size":4964,"stargazers_count":76,"open_issues_count":2,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-05T11:42:23.346Z","etag":null,"topics":["avr","avr-microcontroller","hid","uart","uart-bridge","uart-interface","usbasp","usbasp-firmware"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dioannidis.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-26T15:11:08.000Z","updated_at":"2024-11-02T06:36:56.000Z","dependencies_parsed_at":"2024-01-14T03:51:26.302Z","dependency_job_id":"ea460f5f-75b9-4494-ad0e-fe85cb55b16d","html_url":"https://github.com/dioannidis/usbasp","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioannidis%2Fusbasp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioannidis%2Fusbasp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioannidis%2Fusbasp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioannidis%2Fusbasp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dioannidis","download_url":"https://codeload.github.com/dioannidis/usbasp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247260429,"owners_count":20910004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avr","avr-microcontroller","hid","uart","uart-bridge","uart-interface","usbasp","usbasp-firmware"],"created_at":"2024-08-01T15:01:00.531Z","updated_at":"2025-04-04T22:30:58.110Z","avatar_url":"https://github.com/dioannidis.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# usbasp improved\r\n### _WCID compliant_, _HID UART support_\r\n\r\nThis USBasp firmware is based on [a fork by Ralph Doncaster]. Original fork readme can be found at README_nerdralph.md.\r\n\r\n### Features\r\n- From version 1.07 a default SCK clock of 1.5Mhz and automatic SCK slowing if target does not respond.  PORTD is left as input, so this firmware also works [with USBISP modules]. ( nerdralph )\r\n- From version 1.08 the firmware is [WCID] compliant, meaning it should work on Windows without any driver or .inf install.\r\n- From version 1.09 a ( reliable at 9600 Baud, with 120ms - 160ms intervals for higher speeds see note at UART HID protocol ) UART HID implementation is added for debugging purposes. USBasp will appear as a composite device with a WINUSB interface and a HID interface.\r\n- From version 1.10 USBasp WCID switch to Microsoft OS 2.0 Descriptors. It seems that it play better with USB 3.0 ports.\r\n- From version 1.11 USBasp supports updating it's serial number ( see [USBaspHIDUART utility] ) and also adds support for the AT89S51/2 ICs.\r\n\r\n### Avrdude\r\n\r\n Avrdude v7+ official windows binary from [avrdudes/avrdude] uses libwinusb instead of libusb, which doesn't support composite devices as this firmware implements. Please use the unofficial build using mingw64 ( avrdude-v7.2_mingw64 ) from [mcuee] repo.\r\n\r\n### UART GUI Client\r\n\r\nFrom release v0.7.0, the [libUSBUARTTerminal] supports this firmware's HID UART implementation.\r\n\r\n### UART HID protocol\r\n\r\n\u003e Note: There is a small 128 byte ring buffer for both Tx and Rx. That means you can use higher baud rates ( i.e. 115200 ) if the message length is smaller than 128 bytes and the transmit / receive interval is 160 ms or higher.\r\n\r\n##### _Serial Data_\r\n\r\nV-USB implementation uses 8 byte size input and output interrupt reports.\r\n\r\nThe last byte ( 8th ) has special meaning. Its serial data or its the serial bytes count. If its value is greater than 7 then its serial data. If the value is 7 or smaller then its the serial data count and the remaining bytes are ignored.\r\n\r\n_Input Reports ( USBasp -\u003e USB PC )_ or _Output Reports ( USB PC -\u003e USBasp)_\r\n\r\ni.e.\r\n\r\n```sh\r\n0x55,0x34,0x00,0x00,0x00,0x00,0x00,0x02 -\u003e Actual serial bytes 2 : 0x55,0x34\r\n\r\n0x00,0x34,0x00,0x66,0x32,0x36,0x00,0x04 -\u003e Actual serial bytes 4 : 0x00,0x34,0x00,0x66\r\n\r\n0x00,0xC3,0x34,0x55,0x32,0xF3,0x00,0xAB -\u003e Actual serial bytes 8 ( 8th byte \u003e 7 ) : 0x00,0xC3,0x34,0x55,0x32,0xF3,0x00,0xAB\r\n```\r\n\r\n##### _UART Configuration_\r\n\r\nThe USBasp's UART configuration uses an 8 byte size feature report, with the following format.\r\n\r\n| Byte 0   | Byte 1 | Byte 2 | Byte 3 | Byte 4 - 7  RO |\r\n| -------- | --------- | -------- | -------- | -------- |\r\n| Prescaler Low Byte | Prescaler High Byte | See [UART Flags] | Unused | USBasp Capabilities |\r\n\r\nTo setup and enable the UART, send a feature set report, with the prescaler in the first two bytes and the parity, data bit, stop bit flags at the third byte ( see [UART Flags] ). The fourth byte is ignored. \r\n\r\nTo disable the UART, send a feature set report, with the prescaler bytes as zero.\r\n\r\n\u003e Note: The UART is disabled by default, if read or write is detected for do to not interfere with those functions.\r\n\r\n### USBaspHIDUART utility\r\n\r\nThe USBaspHIDUART is a simple console utility, used for testing the HID UART implementation. \r\n\r\nThis is the help page ( USBaspHIDUART.exe -h ) :\r\n\r\n```sh\r\n\r\nUSBaspHIDUART -h\r\n\r\nUSBasp HIDUART Test App\r\n\r\n -l  List USBasp HID devices\r\n -i  Select USBasp index ( default 0 )\r\n -b  Set Baud ( default 9600 )\r\n -c  Set USBasp Crystal Hz ( default 12 MHz or 12000000 Hz )\r\n -s  Select USBasp with serial number.\r\n     4 Digits numeric only i.e. 3456, 2222, etc ).\r\n -u  Serial Number to update ( 4 Digits numeric only i.e. 3456, 2222, etc ).\r\n     Use with index -i when more than one USBasp are connected.\r\n -r  Continuous read input\r\n -w  Interactive send output\r\n\r\nexamples\r\n\r\nRead from USBasp at index 0 with 4800 baud\r\n USBaspHIDUART -b 4800 -r\r\n\r\nInteractive write to USBasp at index 1 with 9600 baud\r\n USBaspHIDUART -i 1 -w\r\n\r\nInteractive write to USBasp with serial number 1111 with 9600 baud\r\n USBaspHIDUART -s 1111 -w\r\n\r\nRead from USBasp with 20 MHz crystal at index 1 with 19200 baud\r\n USBaspHIDUART -i 1 -b 19200 -c 20000000 -r\r\n\r\nRead from USBasp with 20 MHz crystal and with serial number 2345 with 19200 baud\r\n USBaspHIDUART -s 2345 -b 19200 -c 20000000 -r\r\n\r\nUpdate the first found USBasp's serial number with 3456\r\n USBaspHIDUART -u 3456\r\n\r\nUpdate the USBasp's at index 3 serial number with 3456\r\n USBaspHIDUART -i 3 -u 3456\r\n```\r\n\r\n##### _Build from source_\r\n\r\nBuilding USBaspHIDUART from source is very straightforward :\r\n\r\n\u003e Note: You'll need [FreePascal] 3.0.4 and higher installed.\r\n\r\n( it's always better to build in another directory )\r\n\r\nWindows \r\n\r\n```\r\n\u003cpathtocloneddir\u003e\\utility\\USBaspHIDUART\u003emkdir build\r\n\u003cpathtocloneddir\u003e\\utility\\USBaspHIDUART\u003ecd build\r\n\u003cpathtocloneddir\u003e\\utility\\USBaspHIDUART\\build\u003efpc.exe -MObjFPC -FU. -Fu..\\hidapi.pas ..\\USBaspHIDUART.pas -o.\\USBaspHIDUART.exe\r\n```\r\n\r\nLinux \\ FreeBSD \r\n\r\n```\r\n\u003cpathtocloneddir\u003e\\utility\\USBaspHIDUART\u003emkdir build\r\n\u003cpathtocloneddir\u003e\\utility\\USBaspHIDUART\u003ecd build\r\n\u003cpathtocloneddir\u003e\\utility\\USBaspHIDUART\\build\u003efpc.exe -MObjFPC -FU. -Fu../ -Fu../hidapi.pas -dUseCThreads ../USBaspHIDUART.pas -o./USBaspHIDUART\r\n```\r\n\r\n\r\n[a fork by Ralph Doncaster]: \u003chttps://github.com/nerdralph/usbasp\u003e\r\n[with USBISP modules]: \u003chttps://www.sciencetronics.com/greenphotons/?p=938\u003e\r\n[WCID]: \u003chttps://github.com/pbatard/libwdi/wiki/WCID-Devices\u003e\r\n[MSYS2]: \u003chttps://www.msys2.org/\u003e\r\n[avr8-gnu-toolchain (3.6.2.17778)]: \u003chttps://www.microchip.com/en-us/tools-resources/develop/microchip-studio/gcc-compilers\u003e\r\n[UART Flags]: \u003chttps://github.com/dioannidis/usbasp/blob/167bf1c785b353cba206a0dbcc7d322f7f49d0b9/firmware/usbasp.h#L76)\u003e\r\n[mcuee]: \u003chttps://github.com/mcuee/avrdude/releases/tag/v7.2\u003e\r\n[avrdudes/avrdude]: \u003chttps://github.com/avrdudes/avrdude\u003e\r\n[libUSBUARTTerminal]: \u003chttps://github.com/dioannidis/libUSBUARTTerminal\u003e\r\n[USBaspHIDUART utility]: \u003chttps://github.com/dioannidis/usbasp#usbasphiduart-utility\u003e\r\n[FreePascal]: \u003chttps://www.freepascal.org/\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioannidis%2Fusbasp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdioannidis%2Fusbasp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioannidis%2Fusbasp/lists"}