Close
0%
0%

Not Quite Useless Raspberry Pi Replacement

Make a Raspberry Pi replacement using a Cypress Semiconductor Programmable System on a Chip (PSOC 5)

Similar projects worth following
At Land Boards we make and sell a lot of Raspberry Pi hats. And we like the Pi a lot but find testing our hats to be painful. The Pi is slow to boot and sometimes hard to connect to over Ethernet. It seems like everytime there is a new software build they change something in the Device Tree and the I2C interface (used to program the Hat Personality EPROM) stops working. So what if there was a Pi replacement with the same form factor but with a quick start? Replacing the Raspberry Pi with a Microcontroller would fit the bill. We have a card, the RPPSOC (http://land-boards.com/blwiki/index.php?title=RPPSOC) which puts a PSoC 5 onto a Raspberry Pi hat. What if the hat was used to replace the Pi itself? Enter the RPI_PSOC5.

Features List

  • Boots instantly
    • No waiting for the OS and network to boot
  • Identical Pi interfaces
    • GPIO
    • 3xSPI (can be GPIO)
    • 2xI2C (can be GPIO)
    • UART (can be GPIO)
  • Raspberry Pi hat form factor (65 mm x 56.5 mm)
  • Raspberry Pi 40 pin GPIO connector
    • Fully compatible with Pi hats
    • 3.3V I/O
    • 5V to hat (some of our hats do 5V logic translation)
  • Micro USB Serial port
    • Pi just has a power port
    • 5V powers the card just like the Pi
    • Located in the same place for use in cases
  • Additional I/O connectors - some of them are fixed at 3.3V but one connector can be 3.3V or 5V
  • Invulnerable to Pi software changes
  • Programmed in C using PSOC Creator IDE
    • Extensive peripheral libraries
    • Tons of design examples
  • Programmable logic area
  • Programmable analog area

  • Demo video of RPP_PSOC5

    land-boards.com10/19/2019 at 02:34 0 comments

    Made a short demo video of the RPP_SOC5 card setting all of the bits one at a time on one of our Raspberry Pi Hats.

    The card works really well. I was able to get test code running for all of our I/O cards this afternoon. It was nice to be able to write code so easily for the cards. The EEPROM writes are very fast. Makes me wonder why the Pi is so slow to write EEPROMs. Maybe they are not doing page writes correctly?

    One thing I really like on this card is the USB micro connector. I went with a connector which has four through hole supports - one in each corner. It's expensive, at $2+ but it looks and feels far superior to the cheaper connectors with surface mount supports. Worth the $$$.

    This ends this part of the project. I have full compatibility with the GPIO interfaces of the Raspberry Pi card but there are things I still want to do.

    • I haven't yet touched the additional I/O connectors on the card. I'd like to do a "bounce an LED" test on the two connectors. They add a lot more GPIO to the card beyond the Raspberry Pi 40-pin connector.
    • I haven't tried out the 2nd I2C interface as an I2C interface. We've got an I2C port expander that I'd like to test with the card.
    • I haven't tried the UART interface. Like the other interfaces I've bit banged the pins as GPIO but I'd like to test it as a UART.
    • I haven't put any logic into the logic array part of the card. I have used it in other projects but didn't need any for direct pin output.
    • I'd like to measure current consumption - but it's too low for my USB power meter to measure.
    • It might be fun to put a RPPSOC on as a hat and have two ARM CPUs. I might like to make programming of the RPPSOC.

  • Raspberry Pi Hat ID Writes Working from PSoC

    land-boards.com10/18/2019 at 16:15 0 comments

    const uint8 rpp_uio_16_eeprom[RPP_UIO16_EEPROM_LENGTH] = {
        0x52, 0x2D, 0x50, 0x69, 0x01, 0x00, 0x02, 0x00, 0x6D, 0x00, 0x00, 0x00,
        0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xC0, 0xE9, 0x73, 0x39,
    

    The EEPROM example I included in a previous log was a CAT24C04. This is a smaller EEPROM and only has one single word address at the start of the I2C command (after the Slave Address). I'm not sure how 8-bits work with the CAT24C04 since it has 512-bytes which should need 9-bits of address. 

    Regardless of this, the 24C32 EEPROM used on the hat requires two bytes for address. I set the image to another part and was able to get it to successfully write to the ID EEPROM.

    To do this I added conditional code which uses enums for the different card types. This lets the card type be selected by the main( ) calling code.

    enum EEPROM_Images {
        RPPUIO16,
        RPPGVSCFG,
        RPPSOC
    };

    The call, then, looks like:

    writeEEPROM(RPPGVSCFG);
    

    The dump of the EEPROM on PuTTY looks like:

    Read from the EEPROM
    0000  52 2d 50 69 01 00 02 00 75 00 00 00 01 00 00 00  R-Pi....u.......
    0010  39 00 00 00 7b 27 6f 99 72 25 6c bd 33 46 3e 35  9...{'o.r%l.3F>5
    0020  9f c8 a7 3e 04 00 01 00 0f 12 6c 61 6e 64 2d 62  ...>......land-b
    0030  6f 61 72 64 73 2e 63 6f 6d 52 41 53 50 49 2d 50  oards.comRASPI-P
    0040  4c 55 53 2d 47 56 53 2d 43 46 47 7a 43 02 00 01  LUS-GVS-CFGzC...
    0050  00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    0070  00 00 00 ed 6e 00 00 00 00 00 00 00 00 00 00 00  ....n...........

    The different card type can be seen in the text to the right. Setting the calling value to the PRR-UIO-16 card and doing a write followed by the read shows:

    Read from the EEPROM
    0000  52 2d 50 69 01 00 02 00 6d 00 00 00 01 00 00 00  R-Pi....m.......
    0010  31 00 00 00 c0 e9 73 39 59 5c 8b af 62 4f 19 32  1.....s9Y\..bO.2
    0020  fe 3f 2d d5 05 00 01 00 0f 0a 6c 61 6e 64 2d 62  .?-.......land-b
    0030  6f 61 72 64 73 2e 63 6f 6d 52 50 50 2d 55 49 4f  oards.comRPP-UIO
    0040  2d 31 36 f2 9f 02 00 01 00 20 00 00 00 00 00 00  -16.............
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    0060  00 00 00 00 00 00 00 00 00 00 00 ed 6e 00 00 00  ............n...
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    

    So it looks like it's working well now and it is callable with the different board EEPROM contents.

    Process to Make a New ID EEPROM for the Raspberry Pi

    I've put up bits of this already but here's a thumbnail sketch of making an ID EEPROM for Raspberry Pi Hat. These steps only need to be done once for a particular Hat design or if the device tree needs to be updated for the Hat.

    • Download the tools from the GitHub RPi Hat repository to the Raspberry Pi. There are additional helps there.
    • Study the Design Guide (from above). Particularly, read the ID EEPROM section.
    • The EEPROM format section is here. Don't get scared. There's a tool to help make the file in the proper format.
    • Edit the eeprom_settings.txt text file for your particular hat design
    • eepmake: Parses EEPROM text file and creates binary .eep file. Run this program on the Pi. It will create the eepcfg.eep file.  eepmake could probably compiled to run on any computer and probably doesn't have to be run on a Raspberry Pi but who doesn't like to play with their Pi?
    • Run eepmake with:
      ./eepmake eeprom_settings.txt eepcfg.eep
    • eepcfg.eep is a binary file. Use a tool like HxD to open the file. Export the file as a C array. Use a file name which distinguishes the file from other hats.
    • Add the hat file to EEPROM_Images.c file in the PSoC code.
    • Change the type to const uint8. The result should look like:
      const uint8 rpp_uio_16_eeprom[RPP_UIO16_EEPROM_LENGTH] = {
          0x52, 0x2D, 0x50, 0x69, 0x01, 0x00, 0x02, 0x00, 0x6D, 0x00, 0x00, 0x00,
          0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xC0, 0xE9, 0x73, 0x39,
      
    • The length of the file was indicated in comments in the C array file created...
    Read more »

  • Raspberry Pi ID EEPROM Read Working

    land-boards.com10/18/2019 at 13:22 0 comments

    The functions to read the ID EEPROM on the Raspberry Pi Hat are now working. The expected data is:

    const uint8 rpp_uio_16_eeprom[RPP_UIO16_EEPROM_LENGTH] = {
        0x52, 0x2D, 0x50, 0x69, 0x01, 0x00, 0x02, 0x00, 0x6D, 0x00, 0x00, 0x00,
        0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xC0, 0xE9, 0x73, 0x39,
        0x59, 0x5C, 0x8B, 0xAF, 0x62, 0x4F, 0x19, 0x32, 0xFE, 0x3F, 0x2D, 0xD5,
    ...
    

    The data read from the EEPROM was:

    0000  52 2d 50 69 01 00 02 00 6d 00 00 00 01 00 00 00
    0010  31 00 00 00 c0 e9 73 39 59 5c 8b af 62 4f 19 32
    0020  fe 3f 2d d5 ...
    

    The data matches. I am reading 4 blocks of 32 bytes each for a total of 256 bytes. 

    Took a while to debug. I hooked a logic analyzer up to the EEPROM and found it wasn't accessing the I2C interface. Rookie mistake. I copied the reading code but forgot to include the initialization code in main (goes before the program loop):

        // enable I2C interrupts
        I2C_EEPROM_EnableInt();  
        //Start I2C
        I2C_EEPROM_Start(); 
    

    After adding the initialization code, the read worked. The read code looks like:

    void readEEPROM(uint8 * eepromBuffer)
    {
        uint8 SLAVE_ADDR = 0x50;
        uint8 cMessage[2];
        uint16 cLength = 256;
        
        cMessage[0] = 0;
        cMessage[1] = 0;
        
        //write a dummy byte to initialize the address word counter of 
        //eeprom to start address for read back operation. First location 
        //of cMessage array has word address.
        
        I2C_EEPROM_MasterWriteBuf(SLAVE_ADDR, cMessage, 2, I2C_EEPROM_MODE_COMPLETE_XFER);
        
        //wait until Transfer is complete
        while((I2C_EEPROM_MasterStatus() & I2C_EEPROM_MSTAT_WR_CMPLT )==0);
        
        //Delay for setting address in EEPROM
        CyDelayUs(1);
        
        //Read the 16 bytes from slave, staring from word address specified by iMessage
        //SLAVE_ADDR is the slave address in this API
        //cRx_Buffer is the pointer to array where data has to be stored after reading from EEPROM.
        //cLength-1 is the number of bytes which have to be read from EEPROM
        //I2C_MODE_COMPLETE_XFER, is to read data completly before sending stop command.
        
        I2C_EEPROM_MasterReadBuf(SLAVE_ADDR, eepromBuffer, cLength-1, I2C_EEPROM_MODE_COMPLETE_XFER );
                
        //wait until Transfer is complete
        while((I2C_EEPROM_MasterStatus() & I2C_EEPROM_MSTAT_RD_CMPLT )==0); 
    }
    

    The read function reads 256 bytes from the EEPROM into an array. The pointer  into the array was provided by the calling function in main( ). After reading the array is dumped to the USB and gets displayed in the PuTTY screen.

        uint8 eepromBuffer[256];
    ...
                            readEEPROM(eepromBuffer);
                            dumpEEPROM(eepromBuffer);
    

    I added a plain text field to the right of the read. That lets me see the data as readable characters. Here's the output:

    Read from the EEPROM
    0000  52 2d 50 69 01 00 02 00 6d 00 00 00 01 00 00 00  R-Pi....m.......
    0010  31 00 00 00 c0 e9 73 39 59 5c 8b af 62 4f 19 32  1.....s9Y\..bO.2
    0020  fe 3f 2d d5 05 00 01 00 0f 0a 6c 61 6e 64 2d 62  .?-.......land-b
    0030  6f 61 72 64 73 2e 63 6f 6d 52 50 50 2d 55 49 4f  oards.comRPP-UIO
    0040  2d 31 36 f2 9f 02 00 01 00 20 00 00 00 00 00 00  -16.............
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    0060  00 00 00 00 00 00 00 00 00 00 00 ed 6e 00 00 00  ............n...
    0070  00 00 00 ed 6e ff ff ff ff ff ff ff ff ff ff ff  ....n...........
    0080  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    0090  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    00a0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    00b0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    00c0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    00d0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    00e0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    00f0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff f9  ................
    

    You can see our company name, land-boards.com and the board ID, RPP-UIO-16.

     Next, time to check the write code.  

  • Back to the EEPROM

    land-boards.com10/18/2019 at 01:52 0 comments

    Now that I have C arrays with the card EEPROM files and a short menu (command line interface) running over the USB port I can proceed to get the EEPROM read/write working.

    I've got two functions now: 

    • void readEEPROM(char *eepromBuffer);
    • void dumpEEPROM(char * eepromBuffer);

    The readEEPROM( ) function reads the contents of the EEPROM. The function dumpEEPROM( ) provides a dump of the memory. The third function we need is: 

    • void writeEEPROM(char * eepromBuffer);

    PSoC Utilization

    The PSoC utilization is:

    Flash used: 18696 of 131072 bytes (14.3%).
    SRAM used: 2805 of 32768 bytes (8.6%). Stack: 2048 bytes. Heap: 128 bytes.

    The logic utilization is practically nll.

  • EEPROM File

    land-boards.com10/18/2019 at 01:01 0 comments

    Here's what the hex dump of the ID EEPROM file for the RPP-UIO-16 card looks like:

    I dumped the binary file using HxD which I found here.

    Our company name land-boards.com can be see in the right side as well as the card name RPP-UIO-16. The length is 109 bytes.

    Conveniently HxD exports directly to .c files. The result is:

    unsigned char rawData[109] = {
        0x52, 0x2D, 0x50, 0x69, 0x01, 0x00, 0x02, 0x00, 0x6D, 0x00, 0x00, 0x00,
        0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xC0, 0xE9, 0x73, 0x39,
        0x59, 0x5C, 0x8B, 0xAF, 0x62, 0x4F, 0x19, 0x32, 0xFE, 0x3F, 0x2D, 0xD5,
        0x05, 0x00, 0x01, 0x00, 0x0F, 0x0A, 0x6C, 0x61, 0x6E, 0x64, 0x2D, 0x62,
        0x6F, 0x61, 0x72, 0x64, 0x73, 0x2E, 0x63, 0x6F, 0x6D, 0x52, 0x50, 0x50,
        0x2D, 0x55, 0x49, 0x4F, 0x2D, 0x31, 0x36, 0xF2, 0x9F, 0x02, 0x00, 0x01,
        0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xED,
        0x6E
    };
    

    This should make it easy to load the EEPROM. I will need to rename the array but other than that minor detail this looks like a good approach. srec_cat would probably work just as well but having the HxD editor will be very convenient for what I want to do.

    I am putting the 3 hat EEPROM images into a file: EEPROM_Images.c so that they can be loaded as needed. I am also changing the type from unsigned char to const uint8 so that the array doesn't get moved into SRAM (saving some SRAM).

    The three images are different sizes; 109, 117, and 105 bytes. So I think I just need to have a 128 byte buffer or 4 blocks of 32 bytes each.

  • Simple Command Driven Interface

    land-boards.com10/17/2019 at 20:01 0 comments

    Wrote a very basic command interface with three commands:

    • W - Write the EEPROM
    • R - Read the EEPROM
    • B - Bounce an LED across the RPP-UIO-16 card

    The result looks like this:

    Write to the EEPROM
    Read from the EEPROM
    0000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
    0010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
    0020 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
    0030 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
    0040 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
    0050 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
    0060 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
    0070 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f
    0080 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f
    0090 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f
    00a0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af
    00b0 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf
    00c0 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf
    00d0 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df
    00e0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef
    00f0 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff
    Blinking the LEDs on the RPP-UIO-16 card, please wait
    Completed blinking the LEDs on the RPP-UIO-16 card
    

     For the Write to EEPROM I am filling an array with 0x00-0xFF. For the Read from EEPROM I am dumping the array that was filled. For the bounce LED I am using the routine that I wrote earlier but instead of running it forever, I just run it once.

    Works well. Made a workspace bundle as an archive in the file: RPS_PSOC5_Serial_01.cywrk.Archive02.zip in the GitHub for this project.

  • Test Menu Code

    land-boards.com10/17/2019 at 14:35 0 comments

    I need a really simple test menu. It should display over the USB-Serial interface and run under PuTTY.

    This project started with the PSoC example project: USBUART. Currently, the code is doing the USBUART code which takes the serial data that the PSoC receives and loops it back to the Host.

    Instead of pickup up the code it needs to be interpreted and responses sent back to the Host.

    I think I will implement a very simple command interpreter to being with. The commands will be:

    • R - Read EEPROM and dump results to the Serial to USB
    • W - Write EEPROM
    • B - Blink the LEDs on the RPP-UIO-16 card

    That was fairly easy to do. Here's the code:

           /* Service USB CDC when device is configured. */
            if (0u != USBUART_GetConfiguration())
            {
                /* Check for input data from host. */
                if (0u != USBUART_DataIsReady())
                {
                    /* Read received data and re-enable OUT endpoint. */
                    inCount = USBUART_GetAll(inBuffer);
    
                    if (0u != inCount)
                    {
                        /* Wait until component is ready to send data to host. */
                        while (0u == USBUART_CDCIsReady())
                        {
                        }
                        
                        if ((inBuffer[0] == 'r') || (inBuffer[0] == 'R'))
                        {
                            strcpy(outBuffer,"Read from the EEPROM\n\r");
                            outCount = strlen(outBuffer);
                            USBUART_PutData(outBuffer, outCount);
                        }
                        else if ((inBuffer[0] == 'w') || (inBuffer[0] == 'W'))
                        {
                            strcpy(outBuffer,"Write to the EEPROM\n\r");
                            outCount = strlen(outBuffer);
                            USBUART_PutData(outBuffer, outCount);
                        }
                        else if ((inBuffer[0] == 'b') || (inBuffer[0] == 'B'))
                        {
                            strcpy(outBuffer,"Blinking the LEDs on the RPP-UIO-16 card, please wait\n\r");
                            outCount = strlen(outBuffer);
                            USBUART_PutData(outBuffer, outCount);
                            testRPPUIO16();
                            strcpy(outBuffer,"Completed blinking the LEDs on the RPP-UIO-16 card\n\r");
                            USBUART_PutData(outBuffer, outCount);
                        }
                        else
                        {
                            strcpy(outBuffer,"Not a valid command, legal values are r, w, b\n\r");
                            outCount = strlen(outBuffer);
                            USBUART_PutData(outBuffer, outCount);
                        }
                        /* If the last sent packet is exactly the maximum packet 
                        *  size, it is followed by a zero-length packet to assure
                        *  that the end of the segment is properly identified by 
                        *  the terminal.
                        */
                        if (USBUART_Buffer_SIZE == inCount)
                        {
                            /* Wait until component is ready to send data to PC. */
                            while (0u == USBUART_CDCIsReady())
                            {
                            }
    
                            /* Send zero-length packet to PC. */
                            USBUART_PutData(NULL, 0u);
                        }
                    }
                }
            }
    

  • Raspberry Pi Hat ID EEPROM Details

    land-boards.com10/17/2019 at 12:24 0 comments

    The creation of Raspberry Pi Hat EEPROMs is described in the Foundation's documents.

    The HAT EEPROM allows the hat to describe the function of the GPIO pins. Most of our cards are not for a specific purpose but are I/O breakouts with power distribution. Many of the cards perform 3.3V to 5V translation. As such, there's no dedicated purpose for a given GPIO pin so there's no way to fully pre-determine the contents of the hat EEPROM. In fact, it might even be an input pin or an output pin.  But we still provide the EEPROM on these cards for users who want to fill in the contents based on their specific applications. This is complicated enough to do that most casual users never bother with doing it.

    The hats typically do connect to all pins. But in the case where the hat is designed to fit on either the 40-pin connector or the older 26-pin connector, there's no pins on the additional 14 connector pins.

    Details of the EEPROM Contents

    Details of the EEPROM data format can be found in the EEPROM format specification

    Host Side Software Tools to Create EEPROM Images

    Software tools are available for creation of valid EEPROM images, to flash an image or read and dump and image to/from an attached ID EEPROM. Conveniently the tools are written in C and that's compatible (at least at the language level) with PSOC Creator.

    EEPROM Flashing Tool

    The tool to program and read the EEPROM on the card (eepmake32) obviously don't run on the PSoC so it needs to be re-created.

    The EEPROM image will be loaded into the PSoC Flash Memory when the PSOC is programmed and needs to be made into a C Array from the perspective of the PSoC Creator. We've used one of the srecord utilities called srec_cat to convert binary images into C Arrays before so this would probably be a good tool for this instance. The specific tool can actually be run on the Pi itself to make the binary file:

    eepmake: Parses EEPROM text file and creates binary .eep file

    We've already done this for the hats we currently make and probably will continue to use the Pi for this function. Alternately, the code could be run on a PC or Linux machine.

    EEPROM Physical Interface from the PSoC

    The ID EEPROM is at I2C address 0x50 on ID_SD and ID_SC pins. That is the I2C slave address and is a function of the EEPROM part itself.

    The I2C lines are connected to a dedicated I2C interface in the PSoC.

    The pins are pre-determined for this I2C interface as above. Dropping the I2C Master symbol onto the PSOC Creator schematic page causes API code to be generated for the I2C master function but the API functions need to be called by the program that needs to use the I2C master.

    EEPROM

    We use the recommended On Semiconductor CAT24C32 32Kbit EEPROM for our hats.
    A recommended part that satisfies the above constraints is OnSemi CAT24C32 
    which is a 32kbit (4kbyte) device. 

    The CAT24C32 has the key feature that it has "Hardware Write Protection for Entire Memory".

    We could use either byte write mode or page write mode. The eepflash.sh program uses the linux dd command to copy data from the file to the Flash and there's no easy visibility to which mode it uses.

    The spec for the contents of the flash is here.

    Since the data is only written and read as a block, I'm going to use the Page Write mode. This only comes at the cost of speed and the part is so small that speed isn't particularly critical. Write cycles are 10 mSec. If we were to write to all of the 4KB of the EEPROM that would be 40 seconds. But looking at the file for the RPP-UIO-16 shows that it's only 109 bytes long so this will take a little over a second to flash the portion of the EEPROM we want to flash. That should be fine.

    Let's use a 256-byte block size. Since the EEPROM has 32-byte blocks we will need to break this up into 8 separate block transfers.

    We will use a software delay timer of 10 mS between each write to ensure that the part has completed the previous transfer.

    There is...

    Read more »

  • To Do List

    land-boards.com10/17/2019 at 11:38 0 comments

    There's still quite a few things I'd like to do.

    Menu System for Card Tests

    Since the first target is the Land Boards Raspberry Pi I/O Hats, I'd like a menu system to select the Hat to test. The menu would run over the USB connection and should allow tests to be developed for the hats. I'd like the only host requirements to be running a terminal emulator, like PuTTY which supports Serial over USB.

    The cards are mostly GPIO breakouts that add Ground and Signal as well as do voltage translation of the 3.3V of the Raspberry Pi to 5V signal levels. For these cards it's enough to bounce a light across each of the output pins and light LEDs. This checks for shorts, opens, etc.

    But we do have some other cards, such as a serial port card which does USB to Serial that are more than just testing GPIO lines.

    Hat ID EEPROM Read/Write

    One of the primary reasons I made this card is I don't want to have to figure out how to use the I2C interface everytime Raspbian changes the Device Tree approach. For that to work, I need to be able to program the EEPROM on the hat. If there's a hat that's already been programmed it can be read to automatically determine what hat is attached.

    Not all of our Land Boards Raspberry Pi Cards are technically hats. To be a hat, the card has to have an ID EEPROM. Some of our cards are breakouts and don't have the ID EEPROM. Some of our cards just support the smaller GPIO connector size, as well.

    Cards which have an ID EEPROM include:

    The cards which don't have an ID EEPROM include:

    So there's really only 3 hats on the list (cards with ID EEPROMs). Still it would be nice to have a way to do this without the pain of using a Raspberry Pi.

    Part of the reason it's painful to do this with a Raspberry Pi is that the Pi viewed the EEPROM as something it interrogates at power up rather than a device it want's to let users read. That has to be worked around and most of the workarounds on the Internet just don't work all that well.

  • Testing with Land Boards Card RPP-UIO-16

    land-boards.com10/17/2019 at 11:32 0 comments

    I've got a Raspberry Pi Hat (board) which is an I/O card for the Raspberry Pi, the RPP-UIO-16. It has 16-bits of I/O translators on it as well as connections to all of the GPIO pins on the 40-pin connector. The hat is the standard form factor as other hats and happens to match the RPI_PSOC5 card.

    I hooked up jumpers to take the 3.3V side of the translators to 16 of the GPIO lines from the Raspberry Pi connector. I hooked up 16 LEDs to these 5V signal level lines. I also hooked up LEDs to the other pins and ran code to bounce light across each of the LEDs. This showed that the RPP_PSOC5 can set all of the lines properly.

    The code has been written to use the BCM pin names. On the GPIO connector, these are:

View all 17 project logs

Enjoy this project?

Share

Discussions

Bharbour wrote 09/10/2023 at 15:23 point

This is a lot like the Pi replacement board that I did a while ago: https://hackaday.io/project/170251-smallpi. Different MCU though. It has been a useful board.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates