Close

Details about the waveform implementation

A project log for FPGA eink controller

ice40 FPGA based custom board to control eink display

julienJulien 01/13/2019 at 12:480 Comments

Since multiple people ask me more details about the waveform format used with the FPGA, here is some information.


Each line is one of the phase containing an array of the 4x4 transition possible in the form of 16x2 32bit value (0xFFFFFFFF):
[white to white, white to light grey, white to dark grey, white to black,
light grey to white, light grey to light grey, light grey to dark grey, light grey to black,
dark grey to white, dark grey to light grey, dark grey to dark grey, dark grey to black,
black to white, black to light grey, black to dark grey, black to black]

Each entry take 2bits (0,1,2,3 3 never being used).

For example, if you take line 5 of https://github.com/julbouln/ice40_eink_controller/blob/master/controller/waveform_gc4.hex
0x4028a098 = 0b01000000001010001010000010011000
[01,00,00,00,
00,10,10,00,
10,10,00,00,
10,01,10,00]

So to go from white to white, we will need to apply -V:
[01,00,00,00,
00,10,10,00,
10,10,00,00,
10,01,10,00]

To go from black to white, we will need to apply +V:
[01,00,00,00,
00,10,10,00,
10,10,00,00,
10,01,10,00]
You can see the algorithm there https://github.com/julbouln/ice40_eink_controller/blob/master/controller/waveform.v#L50
waveform_phase[prev_pixel1 + pixel1 + 1],waveform_phase[prev_pixel1 + pixel1]

If previous pixel is black and pixel is white, we would have array[3<<3+0+1:3<<3+0] = array[25:24] (https://github.com/julbouln/ice40_eink_controller/blob/master/controller/waveform.v#L42)

Discussions