Explore the PIC32's Parallel Master Port on a PIC250F256L dev board. Millisecond timer interrupt generated by Timer 1, which also toggles RA7 (SQWAVE).
PIC32MX is connected to two HMDL-2416 starburst displays.
PMP sends four bytes to CS1 and four bytes to CS2. Data bus is eight bits wide and has two address lines (A0 and A1). The address lines select which of the four digits within the display will receive the ASCII data from the data bus. Sends characters to USART3 depending on BUTTON state.
Signal | Chip | Name | Pin | Chip | Name | Pin |
---|---|---|---|---|---|---|
PMWR | PIC32 | RD4/PMWR | 81 | HMDL-2416 | /WR | 6 |
PMRD | PIC32 | RD5/PMRD | 82 | |||
PMCS1 | PIC32 | RD11/PMCS1 | 71 | HMDL-2416 | /CE1 | 1 |
PMCS2 | PIC32 | RD10/PMCS2 | 70 | HMDL-2416 | /CE1 | 1 |
PMA0 | PIC32 | RB15/PMA0 | 44 | HMDL-2416 | A0 | 8 |
PMA1 | PIC32 | RB14/PMA1 | 43 | HMDL-2416 | A1 | 7 |
PMD0 | PIC32 | RE0/PMD0 | 93 | HMDL-2416 | D0 | 11 |
PMD1 | PIC32 | RE1/PMD1 | 94 | HMDL-2416 | D1 | 12 |
PMD2 | PIC32 | RE2/PMD2 | 98 | HMDL-2416 | D2 | 13 |
PMD3 | PIC32 | RE3/PMD3 | 99 | HMDL-2416 | D3 | 14 |
PMD4 | PIC32 | RE4/PMD4 | 100 | HMDL-2416 | D4 | 17 |
PMD5 | PIC32 | RE5/PMD5 | 3 | HMDL-2416 | D5 | 16 |
PMD6 | PIC32 | RE6/PMD6 | 4 | HMDL-2416 | D6 | 15 |
PMD7 | PIC32 | RE7/PMD7 | 5 | |||
Vcc | HMDL-2416 | Vcc | 9 | |||
Gnd | HMDL-2416 | Gnd | 10 | |||
Gnd | HMDL-2416 | /CE2 | 2 | |||
Gnd | HMDL-2416 | CUE | 4 | |||
Vcc | HMDL-2416 | /CLR | 3 | |||
Vcc | HMDL-2416 | /CU | 5 | |||
Vcc | HMDL-2416 | /BL | 18 |
Note that we have two HMDL-2416 displays, so PMCS1 goes to the left-hand one and PMCS2 goes to the right-hand one. The data bus PMD[0-7] and the address bus PMA[0-1] connects to both displays in parallel, as does PMWR. PMRD is not connected (the displays are write-only) and nor is PMD7 (they're 7-bit ASCII). Some pins on the HMDL-2416 displays are tied HIGH or LOW.
PIC32MX is connected to an ILI9486 LCD controller with a 320x480 display. Data bus is 16 bits wide and has one address line (A0). When A0 is LOW, the display accepts commands; when A0 is HIGH, 16-bit pixel data is sent.
The code goes through a sequence of display tests or demos. There's an image of a sunflower stored in Flash which is displayed. Other displays are algorithmically generated, including circles, ellipses, and straight lines. A text font is included and a 16x16 character text display is generated. The goal is to determine if an oscilloscope display can be generated quickly enough to be used in real-time. This takes 18ms when the PIC32MX is clocked at 48MHz.
The speed of the display seems to be limited, ultimately, by the PBCLK speed of the PIC32MX. On the chip we're using at the moment, this is 48MHz. A faster chip is available, running at 80MHz, but seems to require the PBCLK to be slowed down to 40MHz. For CPU-intensive displays, this may be a better choice.
None of the PIC32MX chips that I have on dev PCBs have enough RAM for a full 320x480 frame buffer (300k bytes). The PIC32MX250F256L on the unmodified PCB only has enough Flash for an image that's half the size of the display. I may swap to a bigger PIC32MX570F512L and make a bigger image, but it's a lot of jumper wires to swap over.
Signal | Chip | Name | Pin | Connector | Name | Pin |
---|---|---|---|---|---|---|
5V | P3 | USB_5V | 4 | |||
3.3V | PIC32 | Vcc | P3 | 3V3 | 5 | |
GND | PIC32 | GND | P3 | GND_S | 15 | |
GND | PIC32 | GND | P3 | GND_S | 25 | |
LED | PIC32 | RB9 | 33 | P2 | RB9 | 33 |
SQWAVE | PIC32 | RA7 | 92 | P3 | RA7 | 42 |
RESET | PIC32 | RD3 | 78 | P3 | RD3 | 28 |
U3TX | PIC32 | RC1 | 6 | P2 | RC1 | 6 |
U3RX | PIC32 | RC4 | 9 | P2 | RC4 | 9 |
BUTTON | PIC32 | RA1 | 38 | P2 | RA1 | 38 |
PIC32 pin numbers are for the 100-pin package.
LED lights when the pin is pulled LOW.
Tact switch or pushbutton on RA1, pin 38, with pull-up resistor. Pin goes LOW when pressed.
Signal | Chip | Name | Pin | Connector | Name | Pin |
---|---|---|---|---|---|---|
PMWR | PIC32 | RD4/PMWR | 81 | P3 | DIP1_4 | 31 |
PMRD | PIC32 | RD5/PMRD | 82 | P3 | RD5 | 32 |
PMCS1 | PIC32 | RD11/PMCS1 | 71 | P3 | RD11 | 21 |
PMCS2 | PIC32 | RD10/PMCS2 | 70 | P3 | SCK1 | 20 |
PMA0 | PIC32 | RB15/PMA0 | 44 | P2 | HV_En | 44 |
PMA1 | PIC32 | RB14/PMA1 | 43 | P2 | U1_FAULT | 43 |
PMA2 | PIC32 | RG9/PMA2 | 14 | P2 | RG9 | 14 |
PMA3 | PIC32 | RG8/PMA3 | 12 | P2 | ULEG_TX | 12 |
PMA4 | PIC32 | RG7/PMA4 | 11 | P2 | ULEG_RX | 11 |
PMA5 | PIC32 | RG6/PMA5 | 10 | P2 | LEG_EN | 10 |
PMA6 | PIC32 | RA10/PMA6 | 29 | P2 | RA10 | 29 |
PMA7 | PIC32 | RA9/PMA7 | 28 | P2 | RA9 | 28 |
PMA8 | PIC32 | RF5/PMA8 | 50 | P2 | 3V3FAULT | 50 |
PMA9 | PIC32 | RF4/PMA9 | 49 | P2 | V+FAULT | 49 |
PMA10 | PIC32 | RB13/PMA10 | 42 | P2 | U1_SENSE | 42 |
PMA11 | PIC32 | RB12/PMA11 | 41 | P2 | RB12 | 41 |
PMA12 | PIC32 | RB11/PMA12 | 35 | P2 | RB11 | 35 |
PMA13 | PIC32 | RB10/PMA13 | 34 | P2 | RB10 | 34 |
PMA14 | PIC32 | RD11/PMA14 | 71 | P3 | RD11 | 21 |
PMA15 | PIC32 | RD10/PMA15 | 70 | P3 | SCK1 | 20 |
PMD0 | PIC32 | RE0/PMD0 | 93 | P3 | RE0 | 43 |
PMD1 | PIC32 | RE1/PMD1 | 94 | P3 | CE1 | 44 |
PMD2 | PIC32 | RE2/PMD2 | 98 | P3 | RE2 | 48 |
PMD3 | PIC32 | RE3/PMD3 | 99 | P3 | SDO1 | 49 |
PMD4 | PIC32 | RE4/PMD4 | 100 | P3 | WP1 | 50 |
PMD5 | PIC32 | RE5/PMD5 | 3 | P2 | LEG_Q2 | 3 |
PMD6 | PIC32 | RE6/PMD6 | 4 | P2 | LEG_POT | 4 |
PMD7 | PIC32 | RE7/PMD7 | 5 | P2 | RE7 | 5 |
PMD8 | PIC32 | RG0/PMD8 | 90 | P3 | RG0 | 40 |
PMD9 | PIC32 | RG1/PMD9 | 89 | P3 | RG1 | 39 |
PMD10 | PIC32 | RF1/PMD10 | 88 | P3 | RF1 | 38 |
PMD11 | PIC32 | RF0/PMD11 | 87 | P3 | SDI1 | 37 |
PMD12 | PIC32 | RD12/PMD12 | 79 | P3 | RD12 | 29 |
PMD13 | PIC32 | RD13/PMD13 | 80 | P3 | RD13 | 30 |
PMD14 | PIC32 | RD6/PMD14 | 83 | P3 | DIP2_1 | 33 |
PMD15 | PIC32 | RD7/PMD15 | 84 | P3 | DIP2_2 | 34 |