Skip to content You said: i'd like to port snek to the smart response xe. here are some resources https://pastebin.com/uFfBCQDG https://docs.google.com/document/d/1TT3Tmx0-dsvzmA0lSYiwq4LR293aMV1dJWhriqxD-Po/edit?pli=1&tab=t.0 https://github.com/Subsystems-us/SMART-Response-XE-Tiny-Basic-Port https://github.com/fdufnews/SMART-Response-XE-schematics/blob/master/Smart_Response_XE.pdf https://github.com/fdufnews/SMART-Response-XE-Low_level/tree/master https://github.com/securelyfitz/smartresponse https://github.com/srhg/srxe-wireless-terminal/tree/master https://github.com/notnullgames/smartxe https://github.com/LowPowerLab/DualOptiboot?tab=readme-ov-file https://github.com/ea/srxe_cc1101 https://github.com/fdufnews/SMART-Response-XE-schematics https://github.com/chmod775/SMARTResponseTerminal ChatGPT said: Porting Snek to the SMART Response XE (SRXE) is an exciting idea! Here’s a refined breakdown to guide your effort: 🛠️ 1. Hardware Base & Specs Based on user-reported info, the SRXE clicker features (via Google Groups discussions): ATmega128RFA1 MCU (128 KB flash, 16 KB RAM) 384×136 monochrome LCD 1 Mb SPI flash Numerous buttons (60‑key mini‑keyboard) Battery-powered (~4×AAA) support.smarttech.com+10groups.google.com+10onlinehelp.smarttech.com+10 onlinehelp.smarttech.com+1manualsdir.com+1 This MCU is in the same family (AVR) as many existing Snek targets. 📌 2. Identify Existing AVR Ports The upstream Snek repo already supports AVR devices: ATmega1284, ATmega328, ATmega4809, etc. keithp.com Likely foundational for building an SRXE port. 🧩 3. Low‑Level Hardware Access Available SRXE low‑level resources: GitHub has “SMART‑Response‑XE‑Low_level” with register definitions and basic routines Official schematics and PDFs outline pin layouts manualslib.com These will help implement low-level support for: GPIO for buttons/keys LCD driver routines SPI flash routines (for mass storage) 🔧 4. Bootloader & Runtime SRXE community reports flashing an Arduino-compatible bootloader (e.g., AVRISP / optiboot support) onlinehelp.smarttech.com+3github.com+3keithp.com+3 manualsdir.com+7groups.google.com+7av-iq.com+7 manualslib.com+1manualsdir.com+1 : You could adapt DualOptiboot to support ATmega128RFA1 Alternatively, reuse or customize the existing AVR DFU/bootloader for Snek Having a bootloader allows easy serial flashing via USB or RF. 🧪 5. Porting Snek Itself Steps: Add a new board entry (e.g., atmega128rfa1-srxe) to the Snek build system Define peripheral init routines: console I/O routes to LCD + keypad Hook SPI-flash support for persistent PUT/GET operations Ensure serial ladder: USB serial passthrough or wireless comms Write demo programs to test display and input Gradually expand to GPIO, timers, etc. The existing AVR & EV3 support provide patterns for peripheral abstraction groups.google.com coinmarketcap.com+2keithp.com+2github.com+2 . ✅ 6. Sneezy Task List Task Description Clone upstream Snek + Low‑level code Fork from GitHub Add board config & linker scripts Define AVR flags, memory layout Write hwinit.c, console.c LCD & keyboard input support Add flash.c SPI flash driver Persistent code storage Integrate bootloader support For flashing & debugging Build, flash, test “Hello World” or simple REPL Polish REPL display Multi‑line, scrolling LCD Release & document Create a GitHub repo/project page 🔗 Useful Links & Resources Upstream Snek (AVR targets + interactive console) keithp.com+1studylib.net+1 SRXE schematics/pdf (pins, power, SPI wiring) cisco.com+1studylib.net+1 Low‑level repo: init, hardware definitions Bootloader options: DualOptiboot or Arduino-style from community builds Next Steps 🔭 Clone Snek and low-level repo locally Review schematics to map LCD, flash, keypad pins Draft a basic board file (boards/srxe.c & Makefile) Build and flash a test binary Iterate: display menu, run scripts, load via REPL 🤝 Collaboration & Community The SkullSpace thread indicates an interested DIY hacker base and parts group github.com+1cisco.com+1 keithp.com+1github.com+1 groups.google.com . You might: Open an issue in Subsystems‑us/SMART‑Response‑XE‑Tiny‑Basic‑Port Share early builds for feedback Coordinate on bootloader or serial wiring choices 🚀 Summary Porting Snek to the SRXE is very achievable since: Hardware matches many existing AVR targets Schematics, low‑level code, bootloader frameworks are all available Community interest is active With structured steps—board definition, init code, console, storage, bootloader—you could have a working REPL on the XE in weeks. Let me know if you'd like help drafting board files or a starter firmware repo! You said: also this library will help https://github.com/bitbank2/SmartResponseXE ChatGPT said: Excellent addition — the bitbank2/SmartResponseXE library is a key asset for porting Snek to the SMART Response XE. Here's what it brings to the table and how you can integrate it: 🧩 What This Library Provides bitbank2/SmartResponseXE is a lightweight C++ graphics library for driving the SRXE LCD efficiently. 🖥️ Features: Optimized SPI LCD control Framebuffer support (RAM-based) Drawing primitives: pixels, lines, rectangles, text Efficient full-screen updates Basic font rendering ✅ Benefits: Abstracts the LCD protocol (SPI commands, chip select, etc.) RAM framebuffer lets you treat the LCD as a display buffer and batch update it No external dependencies, suitable for AVR-based builds 🔧 Integration Strategy To use this in the Snek port: 1. Extract Core LCD Code If you're using C (Snek is C-based, not C++), you'll want to: Pull the relevant .c or .cpp files and adapt them to compile as C Or, wrap the display functions in extern "C" and link as C++ At minimum: void srx_lcd_init(void); // Init display void srx_lcd_update(void); // Push framebuffer to screen void srx_lcd_draw_text(x, y, "txt");// Draw functions 2. Replace Snek Console Output Redirect snek_putc() and snek_write() functions to draw characters to the LCD framebuffer instead of serial. You’ll implement a basic text console using: Monospace font (already in the library) Line-wrapping + scrolling Redrawing only dirty lines for speed 3. Handle Input (Keypad) Bitbank2’s library doesn't handle input — use the low-level GPIO or polling code from: SMART-Response-XE-Low_level securelyfitz/smartresponse Then map keypresses to Snek’s REPL input buffer. 📦 Build System Notes If you're compiling Snek for SRXE: Create a new target Makefile.srxe Include bitbank2’s display code in the build Link AVR-GCC with appropriate flags: MCU = atmega128rfa1 F_CPU = 8000000UL CFLAGS += -mmcu=$(MCU) -DF_CPU=$(F_CPU) -Os 🧪 Demo Plan ✅ Display a Snek splash screen using srx_lcd_draw_text() ✅ Implement a one-line REPL loop (draw input + output) ✅ Get keypad input and echo to LCD ⬜ Implement program save/load using SPI Flash ⬜ Add GPIO demos (LED blink, etc.) 🔗 Summary Component Source LCD framebuffer & draw bitbank2/SmartResponseXE Keypad I/O securelyfitz, fdufnews, etc. Bootloader DualOptiboot, or Arduino-ISP MCU / Linker Setup AVR-GCC configs Snek Core keith-packard/snek Let me know if you want a minimal example project to start from — I can scaffold a basic main.c with LCD init, keypad read, and Snek REPL stub. ChatGPT can make mistakes. Check important info.