Skip to content

Commit

Permalink
document the latest work
Browse files Browse the repository at this point in the history
  • Loading branch information
ironsheep committed May 12, 2021
1 parent 67f1850 commit 6c3a6eb
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 18 deletions.
55 changes: 47 additions & 8 deletions HUB75-DriverNewPanel.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Signal Waveforms and timings for driver r1.1
| Single Frame (16 pwm frames) | 1.57 mSec | 636.9 fps |


#### Single PWM Frame (32 rows) timing (@v1.1):
#### Single PWM Frame (32 rows) timing (@v0.1):

![Latch Style](images/64x32pnk_1frame.bmp)

#### Single PWM Row timing (@v1.1):
#### Single PWM Row timing (@v0.1):

![Latch Style](images/64x32pnk_1line.bmp)

Expand All @@ -115,11 +115,11 @@ Signal Waveforms and timings for driver r1.1
| Single Frame (16 pwm frames) | 1.07 mSec | 930.3 fps |


#### Single PWM Frame (32 rows) timing (@v1.1):
#### Single PWM Frame (32 rows) timing (@v0.1):

![Latch Style](images/64x32org_1frame.bmp)

#### Single PWM Row timing (@v1.1):
#### Single PWM Row timing (@v0.1):

![Latch Style](images/64x32org_1line.bmp)

Expand All @@ -146,11 +146,11 @@ Signal Waveforms and timings for driver r1.1 using 64x64 Panel.
| Single Frame (16 pwm frames) | 2.64 mSec | 378.1 fps |
| SCREEN -> PWM Conversion | 5.505 mSec | 181.65 fps |

#### Single PWM Frame (64 rows) timing (@v1.1):
#### Single PWM Frame (64 rows) timing (@v0.1):

![Latch Style](images/64x64_1frame.bmp)

#### Single PWM Row timing (@v1.1):
#### Single PWM Row timing (@v0.1):

![Latch Style](images/64x64_1line.bmp)

Expand Down Expand Up @@ -181,16 +181,55 @@ Signal Waveforms and timings for driver r1.1 using 64x32 Panel.

*NOTE: while the driver can generate 931 FPS, we are limited by the time it takes to convert a full screen image to pwm frames. This is why the final row in this table shows a frame rate of 181 FPS vs. the 931 FPS.*

#### Single PWM Frame (8 rows, 128 px/row) timing (@v1.1):
#### Single PWM Frame (8 rows, 128 px/row) timing (@v0.1):

![Latch Style](images/WorkingPWMFrameRate18.jpg)

#### Single PWM Row timing (@v1.1):
#### Single PWM Row timing (@v0.1):

![Latch Style](images/WorkingPWMLineRate18.jpg)

----

### Driver Chip: ICN2037 (UNKNOWN) for P2 P2 Cube

This is nearly the same as the FM6124 but needs a slower data CLK (Max 20MHz) (wider pulse width) and our 64x64 panels need Red/Blue swapped.
**NOTE** However, I'm successfully clocking the panels at 28.6 MHz (which is faster than the panel 20 MHz max.)

- LATCH_STYLE: ENCLOSED
- LATCH_POSITION: AFTER
- CONFIGURE_PANEL: False
- WIDER_CLOCK: True
- RED_BLUE_SWAP: True
- SCAN_4: False

Signal Waveforms and timings for driver v0.9 using 64x64 Panel.

| | Time | Frequency | |
|----|----|----|----|
| Data CLK | 35 nSec (avg) | 28.6 mHz | |
| Single PWM Row | 14.3 uSec | 69.9 kHz | |
| Single PWM Frame (32 rows, 384 px) | 457.8 uSec | 2.18 kHz | |
| Single Frame (16 pwm frames)| ~7.3? mSec | ~137? fps | (rough estimate, not yet verified!!!) |
| SCREEN -> PWM Conversion | 33.3 uSec | | (less than a single PWM Frame)|

#### Single PWM Frame (6 panels, 64 rows) timing (@v0.9):

![Latch Style](images/P2Cube-pwm-frame-rate.bmp)

A single PWM Frame consists of writing 32 - 384 pixel lines (which paint to the top 32 and bottom 32 rows at the same time.)
In this image this single line starts at Marker M1 (yellow) and ends at Marker M2 (red.)

#### Single PWM Row (6 panels) timing (@v0.9):

When this driver is configured for the P2 P2 Cube (1 chain of 6 64x64 pixel panels) the driver copies two lines of PWM data from Hub RAM to COG RAM, clocks out the two rows then fetches the next 2 rows. Within the driver code these two-row groups are called subFrames. For the 6x64x64 panel-set there are 16 of these subFrames for each PWM Frame. There are 16 PWM Frames creating what we know as a single video frame. The folloing image shows the clocking out of a single subframe (2 lines) which are in Cog RAM.

![Latch Style](images/P2Cube-line-rate-div2.bmp)

If you study the /OE line (output enable bar), in the image above, you can see that every other pulse is wider. This additional width (~715 nS) happens once per subFrame. It is the time it takes to copy our next two rows into COG RAM before they can be displayed. So to get our best approximation of an individual line rate we half the duration of the two line and double the frequency of the two lines: 28.6 / 2 uSec -> 14.3 uSec and 34.9528 * 2 kHz -> 69.9 kHz. This is how we calucated the values shown in the chart above.

----

If you like my work and/or this has helped you in some way then feel free to help me out for a couple of :coffee:'s or :pizza: slices!

[![coffee](https://www.buymeacoffee.com/assets/img/custom_images/black_img.png)](https://www.buymeacoffee.com/ironsheep)
Expand Down
56 changes: 46 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ The P2 HUB75 Driver is available from a couple of sources:
- [The P2 Object Exchange](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2) as "ISP HUB75 Matrix"
- From this repository from the [Releases page](https://github.com/ironsheep/p2-LED-Matrix-Driver/releases)

```
Latest Updates:
11 May 2021
- Significant performance upgrade for P2 P2 Cube support
- Released as v0.9.0 (will bump to v1.x when we get multipanel support working for all supported chips)
10 May 2021
- Added first working 6-panel support enabling P2 P2 Cube use.
```

## Additional Documents

- This README has been repurposed to reflect the current state of the driver as currently released
Expand All @@ -26,16 +35,24 @@ The P2 HUB75 Driver is available from a couple of sources:

What's working today with the current driver:

- Single panel support working well, up to 2048 leds (64x32)
- Single panel support working well for supported chips, up to 4096 leds (64x64)
- Supported Panel Driver Chips: FM6126A, FM6124, ICN2037, and MBI5124 (1/8 scan)
- Multi-panel support working well for ICN2037 chip only (*we're trying to figure out the panel initialization sequences for chips like the FM6126A. Until we do, multi-panel won't work for these panels*)
- PWM'ing images to achieve reasonable color
- Displaying text in both 5x7 and 8x8 fonts
- Initial version of scrolling text - will get more performant in future updates (right to left scroll only)
- Basic color pixel placement at row, column
- Basic drawing primitives
- Loading and displaying images from .bmp files (that are identically sized to your panel)
- Basic color pixel placement at row, column (whole panel-set and single-panel-of-set forms)
- Basic drawing primitives (whole panel-set and single-panel-of-set forms)
- Loading and displaying images from .bmp files (that are identically sized to your single panel) *This demonstration is built for 64x32 panels only, any other will rquire code rework. This is here to demonstrate how it can be done.*

**NOTE:** *With every update we post we also update the [ChangeLog](ChangeLog.md). It will have the most up-to-date driver code/feature status.*

## Pending Development

Upcoming work on the driver:

- Finishing work on initialization of panel chips that require it. It's working for single panels but not multiple panels in the chain.
- Finishing implementation of 2-dimentional panel-set support. Today the driver can handle a single row of multiple panels, but handling N-rows of N-columns of panels needs to be implemented

## Driver Setup and Configuration

Expand All @@ -58,7 +75,6 @@ Here's an example block for a **single panel**:
' [1] ' one panel
'
' (4) describe the organization in numbers of panels
MAX_PANELS = 1
MAX_PANELS_PER_ROW = 1
MAX_PANELS_PER_COLUMN = 1
```
Expand All @@ -81,21 +97,40 @@ Here's an example block for **twin 64x64 panels**:
' [1][2] 1 row of 2 panels
'
' (4) describe the organization in numbers of panels
MAX_PANELS = 2
MAX_PANELS_PER_ROW = 2
MAX_PANELS_PER_COLUMN = 1
```

Here's an example block for **P2 P2 Cube: 6 - 64x64 panels**:

```python
ADAPTER_BASE_PIN = PINS_P32_P47
' (1) determine what form of signalling the driver should use
PANEL_DRIVER_CHIP = CHIP_ICN2037

' (2) describe the panel electrical layout
MAX_PANEL_COLUMNS = 64
MAX_PANEL_ROWS = 64
PANEL_ADDR_LINES = ADDR_ABCDE

' (3) describe the organization of panel(s)
' panels organization: visual layout
' [6] 1 row of 6 panels
'
' (4) describe the organization in numbers of panels
MAX_PANELS_PER_ROW = 6
MAX_PANELS_PER_COLUMN = 1
```


Definition of the constants in the file **isp\_hub75_hwGeometry.spin2**:

| Name | Default | Description |
|-----------------|-------------|-------------|
| `ADAPTER_BASE_PIN` | PINS\_P16_P31 | Identify which pin-group your HUB75 board is connected |
| `ADAPTER_BASE_PIN` | {none} | Identify which pin-group your HUB75 board is connected |
| `PANEL_DRIVER_CHIP` | CHIP_UNKNOWN | in most cases UNKNOWN will work. Some specialized panels need a specific driver chip (e.g., those using the FM6126A, ICN2037, or the MBI5124\_8S) |
| `MAX_PANEL_COLUMNS` | {none} | The number of LEDs in each row of your panel ( # pixels-wide) |
| `MAX_PANEL_ROWS` | {none} | The number of LEDs in each column of your panel ( # pixels-high) |
| `MAX_PANELS` | 1 | **NOTE:** Currently only the CHIP_ICN2037 is working for multipanel displays |
| `MAX_DISPLAY_COLUMNS` | {none} | The number of LEDs in each row of your multi-panel display |
| `MAX_DISPLAY_ROWS` | {none} | The number of LEDs in each column of your multi-panel display |
*The easiest way to do this would be to find an example configuration in that file, copy it and modify it to describe your hardware set up. Making sure, of course that the others are commented out.*
Expand All @@ -118,10 +153,11 @@ There are a couple of demos which you can review then copy and paste from. Thes
| isp\_hub75_demoColor.spin2 | presents the color features of the panel driver, displays a .bmp file |
| isp\_hub75_demoText.spin2 | presents the text and scrolling features of the panel driver |
| isp\_hub75_demo7seg.spin2 | presents a technique for doing multi-step animations using the panel driver |
| isp\_hub75_demoMultiPanel.spin2 | presents techniques for drawing to the various surfaces of our P2 P2 Cube |

**NOTE:** these demo's are built for a 64x32 panel. You may have to modify them to run on your panel.
**NOTE:** most of the demo's are built for a 64x32 panels. You may have to modify them to run on your panel geometry.

Once you have a sense for what these demo's do and how, writing your own display code should be very easy and initially maybe even a copy-n-paste effort from the demo source to your own display code.
Once you have a sense for what these demo's do and how they do it, writing your own display code should be fairly easy and initially maybe even a copy-n-paste effort from the demo source to your own display code.

Please enjoy and let me know if there are features you want to see in this driver!

Expand Down
Binary file added images/P2Cube-line-rate-div2.bmp
Binary file not shown.
Binary file added images/P2Cube-pixel-rate.bmp
Binary file not shown.
Binary file added images/P2Cube-pwm-frame-rate.bmp
Binary file not shown.
Binary file added images/flat-cube1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/flat-cube2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/flat-cube3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6c3a6eb

Please sign in to comment.