ICE

From S1MP3 Wiki
Jump to: navigation, search

ICE

ICE stands for In-Circuit Emulator, see also wikipedia ICE article.

ICE is not tightly related to programming the chip, but since in the early stages we need to flash testing versions of Swan, ICE becomes necessary to reflash a working firmware after having killed the player.

Simple ICE working flow

Steps needed to use an embedded ICE system:

  1. turn on the device which has the embedded ICE system (in our case, turning on the ATJ2085 is enough)
  2. send an impulse to the ICE reset (this is optional on most ICE systems, but needed on our ATJ2085 using the ICERST pin)
  3. calibrate bit communication using the dedicated instruction (this is optional if you already know the frequency to operate at)
  4. enable ICE programming mode
  5. send other instructions...

Note that you don't even need to reset the main device (in our case ATJ2085) to operate ICE. Sometimes there is also an instruction to ask for a "signature" of the ICE system, and it can be used to identify a working ICE system. We think that ATJ2085 systems do have that.

Facts

"When the ICE port is connected to PC, ICEEN# is enabled, the IC (In-Circuit) goes into ICE MODE. When ICEEN# is disabled, the port are mapped to GPO_A2,GPO_A0" (from the ATJ2085 programming guide, p.42)

On the ATJ2085 only 2 pins are exclusively dedicated to ICE:

  • pin46 is ICEEN- (DSU enable, active low)
  • pin47 is ICERST- (DSU reset, active low)

The other 3 ICE-related pins are mapped as follow (depending from ICE MODE activation):

  • pin43 is ICECK (clock input to DSU for debug) or GPO_A1 (Bit1 of general purpose output port A)
  • pin44 is ICEDO (data output from DSU for debug) or GPO_A2 (Bit2 of general purpose output port A)
  • pin45 is ICEDI (data input to DSU for debug) or GPO_A0(Bit0 of general purpose output port A)

NOTE: DSU stands for Debug Support Unit

As you can see, there are two pins (43 and 45) which have different input/output function depending on the ICE MODE correct activation. So, using them as input when mapped as output (non-ICE MODE, or else normal mode), has no effect on the actual input collection; this behaviour can be verified with the pull-up resistor put on them, which shall assert their high-impedance. This double function usually causes display backlight flickering.

We are going to use the ICE interface for memory re-flashing, since some incorrect firmware updates may bring an s1mp3 to a dead state, neither acknowledged as an USB device by the operative system.

We get into ICE mode setting ICEEN to low status.

ATJ2085 ICE

The ATJ2085 ICE pins are mapped as follows:

-------------------------------------------|
|ATJ2085|   ICE   |      Description       |
-------------------------------------------|
|       |         |                        |
|   43  |  ICECK  |  clock purposes (?)    |
|       |         |                        |
|   44  |  ICEDO  |  data out              |
|       |         |                        |
|   45  |  ICEDI  |  data in               |
|       |         |                        |
|   46  | ICEEN-  |  ICE MODE enable       |
|       |         |                        |
|   47  | ICERST- |  ICE MODE reset        |
|       |         |                        |
--------------------------------------------

Related pages

What ICE is NOT: