moved pinouts a bit & added reserved pins for SDA and SCL, added CTS/RTS stuff but not completely implemented yet
This commit is contained in:
parent
c1ac0f89da
commit
74355f5eef
56
README.md
56
README.md
|
@ -56,26 +56,29 @@ Raspberry Pi Pico.
|
||||||
|
|
||||||
The pin mapping for the RP2040 is as follows:
|
The pin mapping for the RP2040 is as follows:
|
||||||
|
|
||||||
| Pin number | Usage |
|
| Pin number | Usage | Usage | Pin number |
|
||||||
|:---------- |:-------------- |
|
|:---------- |:-------------- | --------------:| ----------:|
|
||||||
| GP0 | stdio UART TX |
|
| GP0 | stdio UART TX | | VBUS |
|
||||||
| GP1 | stdio UART RX |
|
| GP1 | stdio UART RX | | VSYS |
|
||||||
| GND | <ground> |
|
| GND | <ground> | <ground> | GND |
|
||||||
| GP2 | SWCLK/TCK |
|
| GP2 | SWCLK/TCK | | 3V3 EN |
|
||||||
| GP3 | SWDIO/TMS |
|
| GP3 | SWDIO/TMS | | 3V3 OUT |
|
||||||
| GP4 | UART TX |
|
| GP4 | UART TX | | ADC VREF |
|
||||||
| GP5 | UART RX |
|
| GP5 | UART RX | | GP28 / ADC2|
|
||||||
| GND | <ground> |
|
| GND | <ground> | <ground> | GND / AGND|
|
||||||
| GP6 | TDI |
|
| GP6 | TDI | | GP27 / ADC1|
|
||||||
| GP7 | TDO |
|
| GP7 | TDO | | GP26 / ADC0|
|
||||||
| GP8 | nTRST |
|
| GP8 | nTRST | | RUN |
|
||||||
| GP9 | nRESET |
|
| GP9 | nRESET | | GP22 |
|
||||||
| GND | <ground> |
|
| GND | <ground> | <ground> | GND |
|
||||||
| GP10 | SCLK |
|
| GP10 | UART CTS | SCL | GP21 |
|
||||||
| GP11 | MOSI |
|
| GP11 | UART RTS | SDA | GP20 |
|
||||||
| GP12 | MISO |
|
| GP12 | MISO | | GP19 |
|
||||||
| GP13 | nCS |
|
| GP13 | nCS | | GP18 |
|
||||||
| GND | <ground> |
|
| GND | <ground> | <ground> | GND |
|
||||||
|
| GP14 | SCLK | | GP17 |
|
||||||
|
| GP15 | MOSI | | GP16 |
|
||||||
|
| <end>| <bottom> | <bottom> | <end>|
|
||||||
|
|
||||||
On the RP2040, two USB CDC interfaces are exposed: the first is the UART
|
On the RP2040, two USB CDC interfaces are exposed: the first is the UART
|
||||||
interface, the second is for Serprog. If you have no other USB CDC devices,
|
interface, the second is for Serprog. If you have no other USB CDC devices,
|
||||||
|
@ -120,15 +123,20 @@ libco is licensed under the [ISC license](https://opensource.org/licenses/ISC)
|
||||||
|
|
||||||
- [x] CMSIS-DAP JTAG implementation
|
- [x] CMSIS-DAP JTAG implementation
|
||||||
- [x] Flashrom/SPI support using Serprog
|
- [x] Flashrom/SPI support using Serprog
|
||||||
|
- [ ] Parallel ROM flashing support, too, by having the device switch into a
|
||||||
|
separate mode that temporarily disables all other IO protocols
|
||||||
- [ ] UART with CTS/RTS flow control
|
- [ ] UART with CTS/RTS flow control
|
||||||
|
- Needs configurable stuff as well, as some UART interfaces won't use this.
|
||||||
|
- [ ] Debug interface to send printf stuff directly to USB, instead of having
|
||||||
|
- to use the UART interface as a loopback thing.
|
||||||
- [ ] I2C support by emulating the I2C Tiny USB
|
- [ ] I2C support by emulating the I2C Tiny USB
|
||||||
- [ ] Expose RP2040-internal temperature ADC on I2C-over-USB bus?
|
- [ ] Expose RP2040-internal temperature ADC on I2C-over-USB bus?
|
||||||
- Does SMBus stuff need special treatment here?
|
- Does SMBus stuff need special treatment here?
|
||||||
- [ ] Maybe add some way of reconfiguring features while the device is running.
|
- [ ] Maybe use the ADCs for something?
|
||||||
Eg. CTS/RTS enable/disable, temperature ADC I2C address, ...
|
|
||||||
- Maybe use the Serprog USB serial interface for this, with some extension
|
|
||||||
commands not typically used for Serprog.
|
|
||||||
- [ ] AVR programming (USBavr emulation?)
|
- [ ] AVR programming (USBavr emulation?)
|
||||||
|
- AVR ISP is hardly used anymore
|
||||||
|
- TPI/UPDI requires 5V levels, Pico doesn't do that :/
|
||||||
|
- debugWIRE????
|
||||||
- Renesas E7-{0,1,2} programming thing????
|
- Renesas E7-{0,1,2} programming thing????
|
||||||
- Renesas tell us how this works pls
|
- Renesas tell us how this works pls
|
||||||
- Maybe steal other features from the Bus Pirate or Glasgow or so
|
- Maybe steal other features from the Bus Pirate or Glasgow or so
|
||||||
|
|
|
@ -67,6 +67,10 @@ void cdc_uart_task(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cdc_uart_set_hwflow(bool enable) {
|
||||||
|
uart_set_hw_flow(PICOPROBE_UART_INTERFACE, enable, enable);
|
||||||
|
}
|
||||||
|
|
||||||
void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* line_coding) {
|
void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* line_coding) {
|
||||||
picoprobe_info("New baud rate %d\n", line_coding->bit_rate);
|
picoprobe_info("New baud rate %d\n", line_coding->bit_rate);
|
||||||
uart_init(PICOPROBE_UART_INTERFACE, line_coding->bit_rate);
|
uart_init(PICOPROBE_UART_INTERFACE, line_coding->bit_rate);
|
||||||
|
|
|
@ -55,6 +55,8 @@
|
||||||
// UART config
|
// UART config
|
||||||
#define PICOPROBE_UART_TX 4
|
#define PICOPROBE_UART_TX 4
|
||||||
#define PICOPROBE_UART_RX 5
|
#define PICOPROBE_UART_RX 5
|
||||||
|
#define PICOPROBE_UART_CTS 10
|
||||||
|
#define PICOPROBE_UART_RTS 11
|
||||||
#define PICOPROBE_UART_INTERFACE uart1
|
#define PICOPROBE_UART_INTERFACE uart1
|
||||||
#define PICOPROBE_UART_BAUDRATE 115200
|
#define PICOPROBE_UART_BAUDRATE 115200
|
||||||
|
|
||||||
|
@ -68,8 +70,8 @@
|
||||||
|
|
||||||
// SPI config
|
// SPI config
|
||||||
#define PROBE_SPI_DEV spi1
|
#define PROBE_SPI_DEV spi1
|
||||||
#define PROBE_SPI_SCLK 10
|
#define PROBE_SPI_SCLK 14
|
||||||
#define PROBE_SPI_MOSI 11
|
#define PROBE_SPI_MOSI 15
|
||||||
#define PROBE_SPI_MISO 12
|
#define PROBE_SPI_MISO 12
|
||||||
#define PROBE_SPI_nCS 13
|
#define PROBE_SPI_nCS 13
|
||||||
|
|
||||||
|
|
4
protos.h
4
protos.h
|
@ -5,8 +5,12 @@
|
||||||
#include "protocfg.h"
|
#include "protocfg.h"
|
||||||
|
|
||||||
#ifdef DBOARD_HAS_UART
|
#ifdef DBOARD_HAS_UART
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
void cdc_uart_init(void);
|
void cdc_uart_init(void);
|
||||||
void cdc_uart_task(void);
|
void cdc_uart_task(void);
|
||||||
|
|
||||||
|
void cdc_uart_set_hwflow(bool enable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DBOARD_HAS_SERPROG
|
#ifdef DBOARD_HAS_SERPROG
|
||||||
|
|
Loading…
Reference in New Issue