diff --git a/README.md b/README.md index b4a3aa0..6feb06a 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,44 @@ As `0x1b02` is called from the main BSL code as part of the "mass-erase FRAM" command, it most likely implements this functionality, and hardly anything else. +### Raspberry Pico NMI signal generator + +To generate the well-timed `NMI` signals, a Raspberry Pico is used. From a +trigger signal from P1.4 to GP14, it will wait a specific amount of time, then +lower GP15, which should be connected to NMI/#RST, for a few microseconds. This +delay between the trigger and NMI is configured over a UART interface on P6.0 +and GP17. P1.5/GP16 is used as an "ack" signal from the Pico to the MSP430 to +signal that the serial command has been received and processed. This is done to +avoid having the MSP430 start sending a trigger signal before a new delay +setting has been applied properly. + +Some other pins are used as handshaking: GP19 is connected to P3.2 to have the +MSP430 wait until this pin is high to start tracing, which is needed because +the NMI pin is also shared between the actual NMI signal, and the Spy-Bi-Wire +debugging interface, which is used to upload new code. Using a switch to select +which line (SBWTDIO or NMI/GP15) is connected to the NMI/#RESET pin, this can +be mitigated. However, then P3.2 needs to be also pulled low for as long as the +NMI/#RST pin is connected to SBWTDIO. For this, another switch can be used to +have it toggle between GND and GP19/3V3. + +The Raspberry Pico code can be found in the `nmigen/` folder (not to be +confused with the HDL language that had this name in the past). + +Full connection table: + +| MSP430 pin | Intermediate pin | Raspberry Pico pin | +|:---------- |:---------------- |:------------------ | +| GND | | GND | +| P1.4 | | GP14 | +| P1.5 | | GP16 | +| | SW1.LEFT | GP19 or 3V3 | +| P3.2 | SW1.MID | | +| GND | SW1.RIGHT | GND | +| P6.0 | | GP17 | +| | SW2.LEFT | GP15 | +| NMI/#RST | SW2.MID | | +| SBWTDIO (from eZ-FET) | SW2.RIGHT | | + ## Proof of concept The code in `src/main.c` will dump the content of the BSL to `eUSCI_A0` in UART