7REV1+ ideas SPI ADC, IO expander, roadmap

I first misread what you wrote and thought you would send them in a day or two. Now I understood that you found out about the parts issue yourself and have already sent the correct parts. Very good.

Hmm, so it could be that the TFT got damaged while screwing the case. Would explain the issue.
Is this something you found during QA on production units too? Or do you think it is more about the case being samples?

Thanks.

2 Likes

About the voltage measuring issue:

This seems to affect all analog measurements for me, not just the Vusb-measurement the self test starts with. So when I inject for example 3.3V from the outside on an IO pin, the ADC still reads 0.02V for this pin when I use the v command.

Also when I enable the voltage regulator, it immediately triggers the overcurrent alert, even when I explicitly disable the current limit.

I’m not sure if this is related. The current limiting circuitry got moved to the new XL9555, but for example the display backlight that is also on the XL9555 works. So this more looks like it is an independent issue.

2 Likes

Yes. Getting vusb is my first step. All the others are not great either. PSU gives an error code and I am aware of why, in the general sense (I2C interrupt not yet implemented). VUSB should work without PSU so there’s a deep issue. I will debug first thing tomorrow when I am fresh and problems solve easier :slight_smile:

2 Likes

HiZ> ~
SELF TEST STARTING
DISABLE IRQ: OK
ADC SUBSYSTEM: VUSB 5.03V OK

:slight_smile: Easy. The new pin config function in the platform file didn’t include the AMUX gpio setup for 7.

Pushed. Now let’s look into the PSU.

  • Fuse reset is ok
  • Fuse works (need to add detect)
  • Fixed read bit for detecting fuse
  • Fuse override works
  • Current sense works

Voltage is stuck at 2.4V though, no matter the set point. With no current limit set the output voltage is 0.7. Hum, seems like the PWMs are swapped?

Yes, that was it.

BIO 1M PULL-UP LOW TEST (SHOULD BE <0.30V)
BIO0 PU-LOW: 0.01V OK
BIO0 SHORT->BIO5 (1/3.00V): ERROR!
BIO1 PU-LOW: 0.01V OK
BIO2 PU-LOW: 0.01V OK
BIO3 PU-LOW: 0.02V OK
BIO4 PU-LOW: 0.01V OK
BIO5 PU-LOW: 0.02V OK
BIO6 PU-LOW: 0.01V OK
BIO6 SHORT->BIO5 (1/3.00V): ERROR!
BIO7 PU-LOW: 0.01V OK

Errors on 1M (now 100K) pull-up and pull-down. Occurring right around 3volt threshold. I think the new 1M pull-down only on XL9555 is enabled by default and causing this. Let’s work on the resistors a bit.

Valid resistor values are:
OFF 1.3K 1.5K 1.8K 2.2K 3.2K 4.7K 10K 100K

Pull resistor configuration:
|  IO0  |  IO1  |  IO2  |  IO3  |  IO4  |  IO5  |  IO6  |  IO7  |
|2.2K U |2.2K U |2.2K U |2.2K U |2.2K U |2.2K U |2.2K U |2.2K U |

1WIRE>

Pullx values updated.

Now I need to integrate the new set of dedicated 1M pull-down on the XL9555 io expander with the pullx and pullx brown out reset.

TODO:

  • Use I2C interrupt to detect over current fuse, don’t slow poll on core 2
2 Likes
Read: 06 | ff ef | 11111111 11110111
Read: 02 | 00 10 | 00000000 00001000
Read: 06 | ff 3f | 11111111 11111100
Read: 02 | 00 c0 | 00000000 00000011
Read: 00 | 83 9b | 11000001 11011001
Read: 06 | 83 10 | 11000001 00001000
Read: 02 | 00 8b | 00000000 11010001

P command dumps the registers for debugging. Maybe this should be a separate command.

pullx appears to be working, but I’ve introduced a bug where the psu thinks it is always over current.

Read: 00 | 83 9b | 11000001 11011001

The bold one indicates the current fuse is ok. It’s something in the code.

Self test

HiZ> ~
SELF TEST STARTING
DISABLE IRQ: OK
ADC SUBSYSTEM: VUSB 5.03V OK
PSRAM TEST: OK
FLASH STORAGE: OK
PSU ENABLE: OK
VREG==VOUT: 3314 = 3300 OK
BIO FLOAT TEST (SHOULD BE 0/<0.30V)
BIO0 FLOAT: 0/0.03V OK
BIO1 FLOAT: 0/0.03V OK
BIO2 FLOAT: 0/0.03V OK
BIO3 FLOAT: 0/0.03V OK
BIO4 FLOAT: 0/0.02V OK
BIO5 FLOAT: 0/0.03V OK
BIO6 FLOAT: 0/0.03V OK
BIO7 FLOAT: 0/0.02V OK
BIO HIGH TEST (SHOULD BE >3.00V)
BIO0 HIGH: 3.30V OK
BIO1 HIGH: 3.30V OK
BIO2 HIGH: 3.30V OK
BIO3 HIGH: 3.30V OK
BIO4 HIGH: 3.30V OK
BIO5 HIGH: 3.30V OK
BIO6 HI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OW: 0.03V OK
BIO3 PU-LOW: 0.03V OK
BIO4 PU-LOW: 0.03V OK
BIO5 PU-LOW: 0.03V OK
BIO6 PU-LOW: 0.03V OK
BIO7 PU-LOW: 0.03V OK
BIO 4.7K PULL-UP HIGH TEST (SHOULD BE 1/>3.00V)
BIO0 PU-HIGH: 1/3.32V OK
BIO1 PU-HIGH: 1/3.29V OK
BIO2 PU-HIGH: 1/3.29V OK
BIO3 PU-HIGH: 1/3.27V OK
BIO4 PU-HIGH: 1/3.27V OK
BIO5 PU-HIGH: 1/3.28V OK
BIO6 PU-HIGH: 1/3.29V OK
BIO7 PU-HIGH: 1/3.29V OK
BIO 4.7K PULL-UP LOW TEST (SHOULD BE <0.30V)
BIO0 PU-LOW: 0.02V OK
BIO1 PU-LOW: 0.02V OK
BIO2 PU-LOW: 0.02V OK
BIO3 PU-LOW: 0.02V OK
BIO4 PU-LOW: 0.02V OK
BIO5 PU-LOW: 0.02V OK
BIO6 PU-LOW: 0.02V OK
BIO7 PU-LOW: 0.02V OK
BIO 10K PULL-UP HIGH TEST (SHOULD BE 1/>3.00V)
BIO0 PU-HIGH: 1/3.29V OK
BIO1 PU-HIGH: 1/3.28V OK
BIO2 PU-HIGH: 1/3.29V OK
BIO3 PU-HIGH: 1/3.31V OK
BIO4 PU-HIGH: 1/3.32V OK
BIO5 PU-HIGH: 1/3.32V OK
BIO6 PU-HIGH: 1/3.30V OK
BIO7 PU-HIGH: 1/3.30V OK
BIO 10K PULL-UP LOW TEST (SHOULD BE <0.30V)
BIO0 PU-LOW: 0.02V OK
BIO1 PU-LOW: 0.02V OK
BIO2 PU-LOW: 0.02V OK
BIO3 PU-LOW: 0.02V OK
BIO4 PU-LOW: 0.02V OK
BIO5 PU-LOW: 0.02V OK
BIO6 PU-LOW: 0.02V OK
BIO7 PU-LOW: 0.02V OK
BIO 100K PULL-UP HIGH TEST (SHOULD BE 1/>3.00V)
BIO0 PU-HIGH: 1/3.30V OK
BIO1 PU-HIGH: 1/3.30V OK
BIO2 PU-HIGH: 1/3.31V OK
BIO3 PU-HIGH: 1/3.31V OK
BIO4 PU-HIGH: 1/3.30V OK
BIO5 PU-HIGH: 1/3.30V OK
BIO6 PU-HIGH: 1/3.30V OK
BIO7 PU-HIGH: 1/3.30V OK
BIO 100K PULL-UP LOW TEST (SHOULD BE <0.30V)
BIO0 PU-LOW: 0.01V OK
BIO1 PU-LOW: 0.01V OK
BIO2 PU-LOW: 0.02V OK
BIO3 PU-LOW: 0.02V OK
BIO4 PU-LOW: 0.01V OK
BIO5 PU-LOW: 0.01V OK
BIO6 PU-LOW: 0.01V OK
BIO7 PU-LOW: 0.01V OK
CURRENT OVERRIDE: OK
CURRENT LIMIT TEST: OK
PUSH BUTTON (ANY KEY SKIPS): OK
RELEASE BUTTON (ANY KEY SKIPS): OK

PASS :slight_smile:

Self test does pass. The over current detection is on the second core which is paused during self test. There is still a bug, but at least this does work.

W 3.3 0

No current limit will work :slight_smile:

W 3.3 300

Any current limit is detected as blow fuse and the PSU is disabled.

2 Likes
Read: 06 | ff 0f | 11111111 11110000
Read: 02 | 00 f0 | 00000000 00001111
Read: 06 | ff 0f | 11111111 11110000
Read: 02 | 00 f0 | 00000000 00001111
psu_fuse_ok: 1
Read: 00 | ff 9b | 11111111 11011001
Read: 06 | ff 10 | 11111111 00001000
Read: 02 | 00 8b | 00000000 11010001

So strange. If the over current detection polling in pirate.c is disabled, then psu_fuse_ok is correct until power is shorted, then it goes to 0. All good.

If I return true from bool xl9555_read_bit(uint16_t bit) instead of actual value, the over current is correctly not detected.

Ok, could be an I2C read/write fail. Added checks for that, but over current is still trigger and no errors are reported.

It does appear psu_fuse_ok is detected as 0 at some point. I’ll scope it tomorrow to see if that is actually happening, but it doesn’t make sense as the fuse hardware is not tripped if the polling is disabled.

The next step is probably to implement the io expander pin change interrupt to detect over current, and then read out the pin states on the interrupt.

TODO:

  • Handle brown out, low voltage start (I2C write fail), voltage change, mode change gracefully with the pullx system.

EDIT: I’m starting to guess it is a race condition with ownership of I2C bus. Currently only the actual read and write is atomic. Maybe the r/w pointer is updated and then some other process is changing it before the read occurs. Seems unlikely, but I don’t know what else it could be at this point.

1 Like

@ian Just a nit. I think that the current fuse bit (bit 12) is one left to the one you highlighted, second word + skip 1 nibble.
Edit---- I am sorry @Ian you are correct. I didn’t realize that your binary printing code is reversed from normal conventions. The LSB is on the left and the MSB is on the right. (little endian at the bit level)

1 Like

Thanks, with your new firmware the ADC is working.

I know the current limit stuff has priority, but I noticed one nit: when you go into the bootloader with $ the display still shows the normal screen. This confused me for a moment. Reason is that the display enable was previously driven from the RP2350 and it enabled the pulldows on reset. Now it is on the XL9555 which just keeps it on.

So I suggest to switch the display enable (or display reset?) via the XL9555 when you execute the reset and bootloader commands.

It isn’t 100% perfect as when you press&hold the reset button the display is still kept on. We could tie the DISPLAY_RESET signal via a diode to the MCU_RESET to fix this. Also would need a resistor between the P11 of the XL9555 and the DISPLAY_RESET to not short when the button is pressed. But I’m not sure if this is hardware feature is really necessary.

2 Likes

Self-test with today’s commit 8cdf790 is passing, with one exception:

The push button test fails.

Specifically, it always thinks that the test has been skipped due to user input. As a result, it reports one error and overall failure. Anyone else seeing the pushbutton test failure?

I can confirm that attempting to set any current limit results in immediately failure, and disabling the current limiter seems to set voltage per the request.

2 Likes

Strange. For me the button test passes without issues. I also built 8cdf790.

@ian I received a small parcel with the opamps today. Thank you.

2 Likes

This is very interesting because I have a similar problem with the auto docs recording of self-test. Though there is no apparent data sent, the self-test skips due to key entry. Something to look further into.

Done

“Interrupts that occur during the ACK or NACK clock pulse can be lost (or be very short) due to the resetting of the interrupt during this pulse.”

The psu fuse fault (what I’m calling it now) is now detected via a gpio interrupt on the RP2350 I2C_INTERRUPT pin.

  1. The XL9555 pulls INT low when any input pin changes.
  2. This triggers GPIO interrupt which sets fuse_fault = true
  3. XL9555 INT is cleared when pins go back to original state or the register is read

It’s working, but I’m suspicious of how reliably.

What I like: short trace to the fuse fault detect components, frees a pin on RP2350, reduces pins needed on AMUX (old method of detecting)

What I don’t like:

  • An RP2350 pin is consumed by the I2C_INTERRUPT signal, which is only used for the single interrupt. Zero net gain.
  • XL9555 INT is unreliable (see above)
  • Added complexity of reading chip to clear interrupt
  • There are 3 free pins on the XL9555 that could be used for future interrupts, but then it is required to read the chip to know the source of the interrupt. Even more complexity and reduced reliability.

I’m leaning towards connecting the fuse fault signal directly to the RP2350 and eleminate the INT singal from the XL9555.

Issue with current?

An issue I noticed: when doing W 3.3 with 300mA limit, then connect VOUT to GND. On my board:

  • Current slowly climbs to ~290 and hovers, sometimes a fuse fault occurs
  • Fuse fault always occurs when removing the connection to ground. This appears to be a hardware issue, but could also be configuration of the PPSU.
  • Verified the current with a multimeter

Lower currents cause fuse fault as on previous hardware.

At least on my board, it appears to have a much lower current capability than previous revisions/versions.

Issue with i2c mutex

If the PSU is disabled via core 2, then higher level functions need to be wrapped in the mutex, instead of the lower level read/write. This is probably the right way to do it anyways.

I’ll clean up my work and push.

1 Like

Just a quick answer, will answer the other points later:

Did you test with a good cable?

I had something similar with my 7Rev0, but I tested with a cheap and thin jumper cable. The cable and connector resistance was probably too high to allow more current at 3.3V. When I repeated it with a proper cable the issue was gone and the BP was able to deliver much more current.

2 Likes

Good suggestion!

I’m using our silicone coated jumpers, there’s an above average amount of copper in there.

Thought about the wimpy cheap USB cable too, so tried with my laptop charger cable with same results. Also previous hardware.

Maybe it is a my setup thing. I’ll test on an old laptop.

1 Like

Fuse is randomly blowing when PSU is enabled and then pull-ups are enabled. Not always, but at least the first few time?

1WIRE> reg i2c
I2C Dump:
Pullx 4:7 (0x20):
IN REG: 00      | 11111111 11111111
OUT REG: 02     | 11110000 00000000
DIR REG: 06     | 00001111 11111111
Pullx 0:3 (0x21):
IN REG: 00      | 11111111 11111111
OUT REG: 02     | 11110000 00000000
DIR REG: 06     | 00001111 11111111
IO EXP (0x22):
IN REG: 00      | 11111111 11011000
OUT REG: 02     | 00000000 11010000
DIR REG: 06     | 11111111 00001000

Added a new reg command to dump registers for debugging. reg i2c shows the I2C chip registers.

The first two are the pullx resistor output and direction.

1WIRE> w
Power supply: Disabled

1WIRE> reg i2c
I2C Dump:
Pullx 4:7 (0x20):
IN REG: 00      | I2C read error
OUT REG: 02     | I2C read error
DIR REG: 06     | I2C read error
Pullx 0:3 (0x21):
IN REG: 00      | I2C read error
OUT REG: 02     | I2C read error
DIR REG: 06     | I2C read error
IO EXP (0x22):
IN REG: 00      | 00000000 11010100
OUT REG: 02     | 00000000 11010100
DIR REG: 06     | 00000000 00001000

1WIRE>

When power is disabled the pullx resistor controller chips lose power and cannot be reached. To keep the pins from floating, the 1M pull-downs on IO EXP (0x22) bits 0:7 should be output (0) and ground (0) during power down or brown out.

This handling seems to be a bit buggy and I’ll clean that up next.

1 Like
Self test no errors

HiZ> ~
SELF TEST STARTING
DISABLE IRQ: OK
ADC SUBSYSTEM: VUSB 4.97V OK
PSRAM TEST: OK
FLASH STORAGE: OK
PSU ENABLE: OK
VREG==VOUT: 3316 = 3303 OK
BIO FLOAT TEST (SHOULD BE 0/<0.30V)
BIO0 FLOAT: 0/0.03V OK
BIO1 FLOAT: 0/0.03V OK
BIO2 FLOAT: 0/0.03V OK
BIO3 FLOAT: 0/0.04V OK
BIO4 FLOAT: 0/0.03V OK
BIO5 FLOAT: 0/0.03V OK
BIO6 FLOAT: 0/0.03V OK
BIO7 FLOAT: 0/0.03V OK
BIO HIGH TEST (SHOULD BE >3.00V)
BIO0 HIGH: 3.31V OK
BIO1 HIGH: 3.30V OK
BIO2 HIGH: 3.30V OK
BIO3 HIGH: 3.31V OK
BIO4 HIGH: 3.30V OK
BIO5 HIGH: 3.31V OK
BIO6 HIGH: 3.30V OK
BIO7 HIGH: 3.31V OK
BIO LOW TEST (SHOULD BE <0.30V)
BIO0 LOW: 0.01V OK
BIO1 LOW: 0.01V OK
BIO2 LOW: 0.01V OK
BIO3 LOW: 0.02V OK
BIO4 LOW: 0.01V OK
BIO5 LOW: 0.01V OK
BIO6 LOW: 0.01V OK
BIO7 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IO1 PU-HIGH: 1/3.31V OK
BIO2 PU-HIGH: 1/3.32V OK
BIO3 PU-HIGH: 1/3.32V OK
BIO4 PU-HIGH: 1/3.31V OK
BIO5 PU-HIGH: 1/3.32V OK
BIO6 PU-HIGH: 1/3.31V OK
BIO7 PU-HIGH: 1/3.31V OK
BIO 4.7K PULL-UP LOW TEST (SHOULD BE <0.30V)
BIO0 PU-LOW: 0.02V OK
BIO1 PU-LOW: 0.02V OK
BIO2 PU-LOW: 0.02V OK
BIO3 PU-LOW: 0.02V OK
BIO4 PU-LOW: 0.02V OK
BIO5 PU-LOW: 0.02V OK
BIO6 PU-LOW: 0.02V OK
BIO7 PU-LOW: 0.02V OK
BIO 10K PULL-UP HIGH TEST (SHOULD BE 1/>3.00V)
BIO0 PU-HIGH: 1/3.31V OK
BIO1 PU-HIGH: 1/3.29V OK
BIO2 PU-HIGH: 1/3.29V OK
BIO3 PU-HIGH: 1/3.28V OK
BIO4 PU-HIGH: 1/3.31V OK
BIO5 PU-HIGH: 1/3.31V OK
BIO6 PU-HIGH: 1/3.32V OK
BIO7 PU-HIGH: 1/3.32V OK
BIO 10K PULL-UP LOW TEST (SHOULD BE <0.30V)
BIO0 PU-LOW: 0.02V OK
BIO1 PU-LOW: 0.02V OK
BIO2 PU-LOW: 0.02V OK
BIO3 PU-LOW: 0.02V OK
BIO4 PU-LOW: 0.02V OK
BIO5 PU-LOW: 0.02V OK
BIO6 PU-LOW: 0.02V OK
BIO7 PU-LOW: 0.02V OK
BIO 100K PULL-UP HIGH TEST (SHOULD BE 1/>3.00V)
BIO0 PU-HIGH: 1/3.30V OK
BIO1 PU-HIGH: 1/3.29V OK
BIO2 PU-HIGH: 1/3.30V OK
BIO3 PU-HIGH: 1/3.31V OK
BIO4 PU-HIGH: 1/3.31V OK
BIO5 PU-HIGH: 1/3.31V OK
BIO6 PU-HIGH: 1/3.31V OK
BIO7 PU-HIGH: 1/3.31V OK
BIO 100K PULL-UP LOW TEST (SHOULD BE <0.30V)
BIO0 PU-LOW: 0.01V OK
BIO1 PU-LOW: 0.01V OK
BIO2 PU-LOW: 0.02V OK
BIO3 PU-LOW: 0.02V OK
BIO4 PU-LOW: 0.01V OK
BIO5 PU-LOW: 0.01V OK
BIO6 PU-LOW: 0.01V OK
BIO7 PU-LOW: 0.01V OK
CURRENT OVERRIDE: OK
CURRENT LIMIT TEST: OK
PUSH BUTTON (ANY KEY SKIPS): OK
RELEASE BUTTON (ANY KEY SKIPS): OK

PASS :slight_smile:

Success! Self test passes.

Pullx resistors should be handling all cases now: no VOUT, VOUT disabled, over current VOUT disabled, switching modes, etc. The chips on my board will work down to 1.4volts (1.65 is datasheet rating) :slight_smile:

PSU is working. The XL9555 interrupt is really fidgety, or I’m missing something. I tried to capture it with a GPIO interrupt and set a flag for further processing in the main loop. This works sometimes, though that may be an issue with my GPIO interrupt setup. There are also additional interrupts when the first 8 IOs are changed to input (disable 1M pull down) which have to be filtered.

What does work 100% of the time is reading the IO expander and looking at the FUSE_DETECT pin state directly. This is what makes me think the INT is a bit weird because the current detect circuit is indeed always in the expected state. This solution means we have to occupy the I2C bus every time we poll the fuse bit. Not the end of the world, but I2C is slow and that core services USB and disk IO.

It’s probably simplest to move current detect to a RP GPIO pin and/or back to AMUX. I think both for the next REV. Technically we don’t even need an interrupt, we could poll the gpio.

Updates pushed. I think this was an excellent revision, but I should have spent more time studying the XL9555 INT before committing to it.

Interested to see @electronic_eel blow one up :slight_smile:

1 Like

@henrygab - In the self test there is now a check for valid character, rather than any character, before skipping the button step. Maybe that will fix it?

Pushed the latest. I think I may have not pushed everything yesterday, theres some reg command stuff in there too.

1 Like
Perhaps this is because my TeraTerm was configured to send `CR+LF`?

  1. command ~ + enter key pressed in terminal program
  2. terminal sends three characters: ~, <CR>, <LF>
  3. command line parsing gets ~, adds to the the command line
  4. command line parsing gets <CR>, and starts running the self-test
  5. self-test gets to the button test portion
  6. self-tets checks if any character in the input queue … and finds <LF> waiting

It seems the hack you put in ignores both CR and LF, as hitting enter did not cause me to skip the test. This is also broken because I could not continue by simply hitting enter multiple times in the terminal.

As a better solution, perhaps the terminal input queue could automatically handle receipt of both CR and CR+LF?

Implementation
static char prior_terminal_character = 0;
int peek_next_terminal_character(...) {
    int next_char = // do normal peek ...
     bool autocr_lf = prior_terminal_character == `\r` && next_char == `\n`;
    if (autocr_lf) {
        // debug message tracking auto-CRLF in peek()
        next_char = // Can we peek two characters ahead in the queue?
    }
    return next_char;
    
int get_next_terminal_character(...) {
     int next_char = // ... normal retrieval of next char
     bool autocr_lf = prior_terminal_character == `\r` && next_char == `\n`;
     prior_terminal_character = next_char;
     if (autocr_lf) {
        // debug message tracking auto-CRLF usage
        // tail recursion for zero stack impact
        return get_next_terminal_character(...);
    }
    // normal handling ...
}
2 Likes

Good catch, that is exactly what is happening. For now I’ll change the message to ‘SPACE TO SKIP’ :slight_smile:

1 Like