Electronics > Projects, Designs, and Technical Stuff
Acute Logic & Lead CCTV PE-1005S HD Camera Module
<< < (8/13) > >>
OzOnE:
Would be good to see if the MIPI thing works out before then, too.

I was just thinking that I'd hate to have to do that mod again if I build a second one. I was going to send the other one to you. lol

For the cost of a few more PCBs, it might be worth it.

PC control will definitely be a feature later on, but as soon as I can get the first I2C commands working, I can hook it up to my OSD.

I'd like to have most of the features available for zoom/macro, manual focus, shutter speed etc.

I think these modules will make for a neat little DIY camcorder, especially if the Rasp Pi idea works out.

I'll hook up the Logic Analyser later, as the commands still aren't quite working. I suspect I may be calculating the checksum wrong.
I can't tell if there's an issue with the way the ESP32 is attempting to read back the response data, though.

It's supposed to do an ACK in between each byte, but I guess that's part of the I2C spec in most cases anyway.

So far, the only "data" I've read back is 0x00 0x01, then the rest are zeroes.
That 0x01 could be the error code, which is saying the checksum isn't right.

The datasheet (I2C) says that the checksum is just a 16-bit value, and is calculated like this...

checksum = 0xFFFF - <Sum of all of the bytes in the packet>

(obviously not including the checksum bytes themselves.)

It also says that any overflow while adding is ignored.
I imagine that means you have to add all of the values of the bytes first, and let it overflow a 16-bit accumulator, then subtract the final value from 0xFFFF.

I'm doing that already, but it's possible it's still wrong. It could simply be that when it overflows, the 16-bit acc value actually wraps?

What I will could try next is just to loop through all of the checksum values with a short delay, to see if the camera reacts.
CJay:
Would be very interested in one of those boards Ash, even if the protocol for the PE1005 isn't complete yet, I'm starting to experiment with FPGA and something that's 'ready to go' with all the HDMI stuff on board would be interesting.
OzOnE:
CJay

I would happily send you a couple of PCBs and the assembly layout, but the problem is those missing traces on the TPD chip.
I'll have to send off for more PCBs soon, with those fixes done.


I finally hooked up the Logic Analyser to the cam / ESP32, and can see now that the ESP32 Arduino library does still in fact have a buffer limit of 32 bytes (not including the address byte). sigh

I was reading up on that issue last night, but I couldn't really tell on the Rigol o'scope, since it's capture buffer is too small.

Not sure how to solve this yet, unless I can find an option in the Arduino source to increase the buffer size.

The problem is, I can't just split the packet then do another Wire.beginTransmission, because that will send the I2C address again, and screw up the data.

Really annoying that this limit of 32 bytes isn't made very obvious on the Arduino site.
I think it applies to many of the AVR chips, too.

It also makes sense now why the cam just keeps returning a packet with the RETRY bit set, because it never sees the last 12 bytes of the packet, nor the checksum.

When it reaches the 32nd byte, the Arduino library is doing another I2C START, so the Logic Analyser interprets that as an address write.

It's also getting a NACK back, because no device exists at address 0x00, but the Arduino library doesn't give an error for this either, since it has overrun 32-byte buffer.

Anyway, at least I can properly debug things now.
I'm using the Sigrok LWLA1034, which I paid around £55 for on AliExpress about four years ago.

I don't think they sell them any more, which is a huge shame, as it's a great LA for the money.
https://sigrok.org/wiki/Sysclk_LWLA1034

I'll try to send off for a few more PCBs soon, as I don't fancy soldering those strands of wire again, especially since I already have the nice stencil made.

Only other thing is to fix the pinout of the voltage regs, and add a few more vias around the ground tabs.
The regs are only getting warm-ish, so there's no problem with the dissipation, luckily.
OzOnE:
I tried changing the buffer length in twi.h and wire.h to 64, but that was for the AVR chips.

(on the off-chance that the ESP32 might be using those parameters.)

It turns out that the ESP32 Wire library already has an I2C buffer length of 128, so I have no idea why it's not working for 44 bytes.

More Googling required, I think.
OzOnE:
Tried updating the ESP32 core using get.exe in Documents\Arduino\hardware\espressif\esp32\tools, but no joy.

In the newer core on github, it has that define for a 128-byte buffer, but it looks like it's still being clamped to 32 bytes in the code itself.

I'll try changing those values to 64, and see if it works. Worth a shot.

(probably need to close then re-open the Arduino IDE first. I'm not even sure if it will definitely compile all of the source files each time.)
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod