{"id":26854752,"url":"https://github.com/alchemist-aloha/rp2040_ccd_tcd1304","last_synced_at":"2025-03-30T23:27:53.751Z","repository":{"id":277031506,"uuid":"858808491","full_name":"Alchemist-Aloha/RP2040_CCD_TCD1304","owner":"Alchemist-Aloha","description":"Read from Toshiba TCD1304 CCD with RP2040 based MCU","archived":false,"fork":false,"pushed_at":"2025-03-22T14:44:54.000Z","size":1785,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T15:32:06.356Z","etag":null,"topics":["ccd","pico-sdk","raspberry-pi-pico","rp2040","tcd1304"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alchemist-Aloha.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-09-17T15:12:33.000Z","updated_at":"2025-03-22T14:44:58.000Z","dependencies_parsed_at":"2025-03-22T15:36:11.336Z","dependency_job_id":null,"html_url":"https://github.com/Alchemist-Aloha/RP2040_CCD_TCD1304","commit_stats":null,"previous_names":["alchemist-aloha/rp2040_ccd_tcd1304"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alchemist-Aloha%2FRP2040_CCD_TCD1304","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alchemist-Aloha%2FRP2040_CCD_TCD1304/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alchemist-Aloha%2FRP2040_CCD_TCD1304/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alchemist-Aloha%2FRP2040_CCD_TCD1304/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alchemist-Aloha","download_url":"https://codeload.github.com/Alchemist-Aloha/RP2040_CCD_TCD1304/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246395273,"owners_count":20770231,"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":["ccd","pico-sdk","raspberry-pi-pico","rp2040","tcd1304"],"created_at":"2025-03-30T23:27:53.356Z","updated_at":"2025-03-30T23:27:53.734Z","avatar_url":"https://github.com/Alchemist-Aloha.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Work in Progress!!\n\n## [TCD1304](https://toshiba.semicon-storage.com/us/semiconductor/product/linear-image-sensors/detail.TCD1304DG.html) with Raspberry Pi Pico\n\nThis project implements a simple TCD1304 CCD driver using the Raspberry Pi Pico microcontroller. The TCD1304 is a 3648-pixel linear CCD sensor, and the Raspberry Pi Pico is a dual-core Cortex M0 microcontroller with a built-in 500 ksps ADC.\n\nTo view the captured spectrum, upload the compiled UF2 file from `TCD1304.c`, and then run `plot.py` to visualize the data received via the USB serial port.\n\nThe image below shows the spectrum captured from the TCD1304 with a 100 µs integration time and averaging over 10 frames. The spectrum is inverted on the y-axis, meaning low photon count corresponds to high ADC values. The peak in the middle of the spectrum is due to a shadow on the CCD detector.\n\n![image](doc/captured_100us_10avg.png)\n\n## Hardware Setup\n\nThis project utilizes the typical drive circuit from the TCD1304 datasheet, excluding the use of the 74HC04 Hex inverter.\n\n![image](doc/circuit.png)\n\n## Timing\n\nThe RP2040's ADC operates at 500 ksps, capturing data via DMA, which synchronizes with the 2 MHz Master Clock (MC) of the TCD1304. The integration time (Shift Gate cycle) is currently set to 100 µs, while the full 3648-pixel readout time is approximately 80 ms.\n\nCurrent timing provides basic functionality, but the stability of the signal is not ideal due to the unsynchronized nature of SH, ICG, and MC. Additionally, the ADC capability of the Raspberry Pi Pico limits the readout quality, providing only 8-bit resolution at 500 ksps with DMA.\n\n![image](doc/timing.png)\n\n## To Do\n\n- Use the second core to handle output work.\n- Use IRC to fine-tune the SH and ICG signals.\n- Implement RTOS for better timing control.\n- Consider using a different microcontroller with a better ADC, such as the STM32 family.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemist-aloha%2Frp2040_ccd_tcd1304","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchemist-aloha%2Frp2040_ccd_tcd1304","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemist-aloha%2Frp2040_ccd_tcd1304/lists"}