Programming iCE40HX1K-EVB with any Arduino board

Started by elNahual, July 15, 2017, 01:18:54 PM

Previous topic - Next topic

elNahual

I'm interested in programming the iCE40HX1K-EVB board. You say it can be programmed with any Arduino board. Many users have all kinds of Arduino boards at home, but they do not necessarily have an Arduino 32u4 with UEXT conn.

So, the connnector on Arduino called ISP (sometimes ICSP) has 6 pins:
1 - MISO
2 - 5V / 3V3
3 - SCK
4 - MOSI
5 - RST
6 - GND

The UEXT conn which is on the iCE40HX1K-EVB has 10 pins:
1 - 3V3
2 - GND
3 - TxD (for RS232)
4 - RxD (for RS232)
5 - SCL (for I2C)
6 - SDA (for I2C)
7 - MISO
8 - MOSI
9 - SCK
10 - SSEL

I think the connections are very simple, but it should be kept in mind:
- the power supplied from the Arduino to the iCE40HX1K-EVB board is 3V3, (not 5V!)
- soldering of the 3V3 solder jumper on the back of the iCE40HX1K-EVB is required (I think)

But I still have two questions:
1 - what happens to the RST signal (pin 5) on the ISP conn (Arduino board)? Is it connected or not?
2 - what happens to the SSEL signal (pin 10) on the UEXT conn (iCE40HX1K-EVB board)? Is it connected or not?

Thanks for any clear answer that follows these questions.

LubOlimex

In short - instead of trying to use the 6-pin ISP header, try to emulate the UEXT of 32u4 with your board (minus RX and TX since these are not required). Else even if possible to establish hardware connections (I'm pretty sure you need more signals and these pins would not be sufficient) you would also need to write software sketch.

Note that iCE40HX1K-EVB has no UEXT connector but programming connector as seen here: https://www.olimex.com/wiki/images/f/f8/ICE40PGM.jpg - RX, TX and 3.3V are disconnected by default. There is no I2C.

The hardware connection between 32u4 and the board is described here:

https://www.olimex.com/wiki/ICE40HX1K-EVB#Hardware_connection_between_OLIMEXINO-32U4_and_iCE40HX1K-EVB

Quote- soldering of the 3V3 solder jumper on the back of the iCE40HX1K-EVB is required (I think)
- don't do that, leave it as per default; people should really stop trying to power the boards via the headers, when there is a power jack provided and when the headers are designed to be output only.

Quote1 - what happens to the RST signal (pin 5) on the ISP conn (Arduino board)? Is it connected or not?

I have no idea what happens with it since we don't use ISP pins. We use a GPIO in for the reset.

Quote2 - what happens to the SSEL signal (pin 10) on the UEXT conn (iCE40HX1K-EVB board)? Is it connected or not?

The easiest way to do is to inspect the definitions in the programmer sketch: https://github.com/OLIMEX/iCE40HX1K-EVB/blob/master/programmer/olimexino-32u4%20firmware/iceprog.ino

#define LED 17 //not mandatory
#define CDONE 3
#define RESET 2
#define UEXT_POWER 8 //specific for 32u4 since it has power control on the UEXT
#define CS  13

The important ones are:

#define CDONE 3
#define RESET 2
#define CS  13 //also known as SS

Note that MISO, MOSI, SCK are also used but not defined since they are already defined. So you need 6 data signals. Just use the MISO, MOSI, SCK of your board and use 3 free GPIOs for CDONE, RESET, CS... Edit the definitions of the ino sketch to match your hardware connections and board and you are good to go. 
Technical support and documentation manager at Olimex