MicroMod Beta Testing

I will take a look, but one hair brain idea is to leave FLEXIO_SHIFTCFG_PWIDTH(7);
But not configure those pins as FlexIO. Long term not good, as maybe I want to use them for some other FlexIO thing...

Bad news just tried it and no-joy. Just get a blank screen.
 
@defragster
Did catch and made the change to test for MM_ML for SD.begin. Left the ML stuff in.

'_hmConfig 0' - GPIO8bit: 'f' works fine. Been running 'F' quite a while no with no finger tearing noticable.
'_hmConfig 2' - HM01B0_TEENSY_MICROMOD_DMA_8BIT: 'f' works great. 'F' and 'V' not working - think thats something @KurtE has to check out I think. Saw it on the 7789 as well
'_hmConfig 2' - change frameRate to 15fps and 'F' works great. Picture nice and steady.
'_hmConfig 1' -both work fine as far as I can see.
'_hmConfig 3' 4 bit GPIO: as you said 'f' is working - funny I can see my fingers wiggling using 'F'. Oh one note. I hooked up display directly to header and am using pin 9 since in 4bit mode pin 9 isn't used anymore for data :)


View attachment 24529
Make sure you have "Set to BMP" selected before you hit capture. And size set to 320x240 Don't need the IP address.

Good to see pin 9 good for DC with 4 bit. Cutting would have been bad.

ArduCam no image - confirmed those settings. Had to unblock the EXE - now seeing the DLL's also blocked? Unblocking the dozens of those hasn't helped yet? I see the SIZE counting up as bytes are received ... but not displayed?
> PDE still showing BLUE torn non-image?

4-40 Imperial Standoffs - explains why my two metric sets failed to work :(
 
Good to see pin 9 good for DC with 4 bit. Cutting would have been bad.

ArduCam no image - confirmed those settings. Had to unblock the EXE - now seeing the DLL's also blocked? Unblocking the dozens of those hasn't helped yet? I see the SIZE counting up as bytes are received ... but not displayed?
> PDE still showing BLUE torn non-image?

4-40 Imperial Standoffs - explains why my two metric sets failed to work :(

4-40's: now you know why I asked :)

Funny Arducam isn't working for you.
This Arducam in GPIO4bit that I am getting:
Capture.PNG

Just tried the Processing sketch - see what you mean about the blue. Tried in in GPIO8bit:
Capture1.PNG

to be honest no idea why. Image is there but just in blue?
 
That missing calAE() was noted in yesterday PR - I removed the calls thinking it was defunct - you did make mention of it ...

ArduCam looks the same - but I only get TEXT in the right pane:
ArduCamTEXT.png

Is it right to hit Capture then in TyComm 'p' to send image?
 
Nope. Don't need dual serial for use with arducam. matter of fact for Arducam use just compile with serial. Keep serial monitor closed when using arducam app. Then just connect with the app, select set to BMP and hit Capture and you should see the image pop up in another window.

Oh - found the problem with 'p'. Dumb copy and paste error! Here is what it should look like:
Code:
  #if defined(USB_DUAL_SERIAL) || defined(USB_TRIPLE_SERIAL)
        uint16_t pixel;
        memset((uint8_t*)frameBuffer, 0, sizeof(frameBuffer));
        hm01b0.readFrame(frameBuffer);
        uint32_t idx = 0;
        for (int i = 0; i < FRAME_HEIGHT * FRAME_WIDTH; i++) {
          idx = i * 2;
          pixel = color565(frameBuffer[i], frameBuffer[i], frameBuffer[i]);
          sendImageBuf[idx + 1] = (pixel >> 0) & 0xFF;
          sendImageBuf[idx] = (pixel >> 8) & 0xFF;
        }
Going to push the change now.

EDIT: Change pushed to Github. Thanks.
 
Git Gotten
Okay - single Serial - TyComm Serial Off - Capture works ... though fast capture gets torn images ...
 
Funny what mode are you using. Haven't seen any torn images with those settings. Tested with FlexIO, DMA and GPIO (4 and 8bit)?
 
Used the INO as on GIT - just changed display.

Just did some fast captures and saw one 'garbage pixel strip' - but not what I saw before ... then clicking too fast the ArduCam app CLOSED itself away :)

Here is a good image I got:
ArduCamImage.png
 
Oh ok. That doesn’t sound like an issue with the lib. Think in the ardu lib when the do a capture they added a bit of a delay. But at least you got it working
 
Back to FlexIO 4 bit...

For the heck of it, I added some debug output at the end of: readFrameFlexIO
Code:
    uint32_t *p = (uint32_t *)buffer;
    for (uint16_t i = 0; i < 256; i++) {
        Serial.printf("%08x ", p[i]);
        if ((i & 0xf) == 0xf) Serial.println();
    }
	arm_dcache_delete(buffer, length);
And when I tried to read in a frame I see:
Code:
Reading frame
Reading FlexIO frame.......................................
00000000 2f2f0000 30300000 34320000 30320000 302f0000 37320000 4f410000 5b560000 5f5e0000 5f5f0000 64610000 64640000 66660000 69680000 69670000 
696c0000 6d6b0000 6f6f0000 746e0000 75710000 74720000 77770000 7a780000 7d7b0000 7e7e0000 83800000 85850000 82880000 72820000 3e540000 3d3c0000 
3a3a0000 3d3a0000 56440000 9c7d0000 a8a50000 b0ab0000 b3b50000 bfba0000 c2c30000 c7c20000 cdc80000 cecc0000 d3d50000 dad90000 dddb0000 dbdf0000 
d7d50000 d3d20000 c8ce0000 c1c60000 bcb70000 adb20000 92a40000 878d0000 86880000 80810000 7a7b0000 7b7b0000 7d7e0000 777d0000 7f790000 8b860000 
8b8d0000 89860000 8a850000 8c890000 8b8b0000 8f8c0000 918d0000 94920000 97930000 9d980000 a09e0000 b1a60000 d1be0000 dbd70000 e5e10000 dedf0000 
dae10000 e1de0000 dedf0000 e7e10000 ebe90000 e9ee0000 efed0000 ecf00000 f1f10000 f4f60000 f4f90000 f6f80000 fbf80000 fafe0000 f9fa0000 fbfc0000 
fdfa0000 f9fb0000 fffd0000 fbfc0000 f8fb0000 f9ff0000 fbfe0000 fbfb0000 f9f70000 fdfb0000 fafb0000 f6fc0000 fcfc0000 fbff0000 fffd0000 fefb0000 
f9fb0000 f6f90000 fcfc0000 fbfc0000 fcfc0000 f8f50000 fbf90000 f5f60000 f8f20000 f1f50000 eff10000 f1ef0000 ecf00000 eef00000 ebee0000 e8e50000 
e6ea0000 e6e40000 d7e40000 bcbc0000 afb80000 b2ae0000 adaf0000 adad0000 acaa0000 aaac0000 a7a60000 a1a20000 9b9a0000 979a0000 95980000 81890000 
767b0000 6f750000 6d6b0000 5d6d0000 52560000 514e0000 4c4f0000 49490000 4e4a0000 504f0000 554e0000 55560000 52550000 4c4f0000 494e0000 47480000 
43450000 43420000 46430000 00000000 2f2f0000 312f0000 32310000 30320000 312e0000 3f370000 55490000 5c590000 5e5f0000 62600000 64640000 65660000 
68670000 6a690000 6d6b0000 6e6b0000 716b0000 706f0000 6f720000 73720000 76770000 79750000 7a780000 7e7f0000 807f0000 7f800000 80820000 82830000 
75830000 42540000 3a3c0000 3a3c0000 3e3b0000 54420000 9b7b0000 a4a10000 aeac0000 afae0000 b9b40000 c0be0000 c1bf0000 c7c40000 cbcb0000 d1d10000 
d2d60000 d9d70000 d6d70000 d7d60000 d2cc0000 c6c80000 b7be0000 b3bd0000 a0ac0000 8c930000 82890000 81850000 7b7f0000 7b7d0000 7d7e0000 7d7c0000 
7b7e0000 7e780000 8a840000 8a8c0000 88880000 89880000 8a890000 8a8b0000 8d8d0000 8d8a0000 8e8d0000 92940000 9a990000 9f9c0000 9fa20000 ada60000 
c5b60000 d3d20000 dbd50000 ded90000 ddda0000 dfe10000 e7e50000 e9e60000 eceb0000 efed0000 f3ee0000 eff00000 f5f10000 f4fb0000 f8f90000 fcf60000 
Finished reading frame

Now if I then convert back to 8 bit FlexIO, I get output like:
Code:
Reading frame
Reading FlexIO frame.......................................
35350000 39393836 34353638 4e443b39 5d5d5a55 5e605e5e 68646060 6b696868 696d6869 6e6e6e6d 706e706d 73747272 78797775 7b7f7a78 6d7e8280 3e43454f 
43413e3f 94795548 a09e9c98 afa7a9a7 b9b4afb1 c3bebdbc c4c2c7c3 ccc7c8c7 bfc3c8c4 afb7b5be a0a5aaae 82858d97 787b7f7f 77757777 7779787d 807f7774 
7e7e8484 82838082 87838787 8b8b8785 908f8a8a 9f9c9392 c9c4beb1 cccdcacc c8ccc7c9 d1cececc d6d2d1d3 d9d9ddd4 e1d9dade dfe1dfe2 dee8e7de e8e4e4e8 
e6e1e1e1 e2e4e4e4 e1e1e6df e4e4e2e6 e1e1e4e7 e2e1dee6 ece8e4de dce1e7e2 e1e1e1e4 dfdfe1de dee1e2e4 dedad9e1 d9dadcde d7dcd9da d6d9d7d7 d3d4d2d6 
cdd3d3d1 aeadbfcc a4a4a3a4 9d9ea0a3 999c9f9e 95959799 838a8d92 5d606b7b 54515856 5b5d5a55 5556565b 56585654 55535151 56585d5a 4e505153 4a4a4b4f 
45454546 41440000 36360000 38383835 36343636 544a433a 5e5b5859 6062605f 64656366 6868666a 6f6d6b69 6f6e6e6e 6f726f70 78727474 78777974 797d7a7a 
727f7e7e 40404555 403e3c3e 92735145 a09d9e98 aeaca7a2 b3b3b1ad bcbcb3b8 c3c7c3c2 c8cac6c9 bcc3c4c7 aeb1b8bd 93a0a4aa 80808488 777b7e7d 79777879 
75777878 807f7a73 7e838484 87808583 83848884 87888380 8f8f8b87 9995938e afa89c99 c8c4c1c1 c9cac7c8 cececdca d7d3d6ce d4d7d6d8 e1dddcda dde2e1e2 
e4e1e3e4 e6e8e1e6 e7e7e1eb e6e2e4e4 e8ebe7e8 e1dfe7e8 dfe1e1e4 e1dfe7e4 e4e2e6e9 e1e8e2e7 e2e2e1e8 e1e1e7e6 e1dfdee2 dce2e2e6 dcdddedc d9dcd9d9 
d7d3d6d8 d3d2d7d4 d1d3d4d4 aeb7c9cd a2a7a9ac 9fa39ea4 9e9c9c9c 9897999c 77898f92 585d5e66 53535455 5e606359 5656595b 56595858 5b565354 5b5a5b5e 
53505555 4d4b4e50 45444549 44440000 35340000 3a383838 38353638 56504640 5e5d5d58 62625f60 65656563 69666969 6d6a6969 706e6f6d 73726f72 75727275 
7f7b7875 7e7e7b7a 777e7e80 40404556 41403f3e 8e705044 a4a09d95 a9a5a3a3 b5b3acae bdb8b9b4 c4c1c1ba c4c1c1c3 b9bdc1bf a8b1b3b9 87909ea5 7f7f8484 
7979797b 79757778 74777578 847a7573 7d7f8287 837f8280 84838483 87848384 8e898987 9792928e 9a959795 bfbaa99e c9c4c3c2 d1d1ceca d9d3d2ce d7d6d7d8 
e1e1d8da e1e4e6df ebe7e4e7 e7e9e7e9 e1ebe8e9 e4e6e9e7 e7e4eceb e7e7e4df e2e7e7e4 e8e7e7e9 e7e8e1e8 e6e8e7e6 e8e6e9e1 e6e4e6e1 dfdfe6df e1e2e1df 
dce7dfdc dcd9dcde d8dad8da d8d7d2d8 d1d7d3d2 c1cccfd3 a7a9acb3 a4a0a4a5 9e9fa3a0 98999a99 687e8995 545b5e60 58505454 646d6d68 585a5e5e 58595858 
605a5658 5a5e5f5e 5656555a 4d4e5055 4846494a 44450000 35350000 39363835 3c393638 59554f44 5e5f5e5b 62636260 66656463 6b6a6a68 6e6b6a6b 726f6e6e

So you can see for each set of transfers we are only grabbing 4 nibbles in 8 bit mode 4 bytes... Since the DMA is setup to transfer 32 bits at a time...
My first guess is we need to look at the settings in this register:
Code:
	FLEXIO2_TIMCFG2 = FLEXIO_TIMCFG_TIMOUT(1) | FLEXIO_TIMCFG_TIMDEC(2)
		| FLEXIO_TIMCFG_TIMENA(6) | FLEXIO_TIMCFG_TIMDIS(6);
I thinking the timer is cycling through 4 cycles before it triggers a DMA operation. Where we need it to cycle through 8 in this case...
 
Actually I think the first thing that needs to change is:
Code:
	// TIMCMP, page 2937
	FLEXIO2_TIMCMP2 = 15;
The Timer decrements on both edges and was 7, it resets to this when it decrements to 0. Before 7 or 4 pulses each 8 bits so fills the 32 bits.
So we are now doing 4 bits so need 8 transfer or 16 and think then -1... so 15.

I now get different garbage on the screen.
Code:
HM01B0 Camera Test
HM01B0_TEENSY_MICROMOD_FLEXIO_4BIT
------------------
FlexIO Configure
 CCM_CSCMR2 = 13192F06
 div1 = 2, div2 = 2
 FlexIO2 Frequency = 120.00 MHz
 CCM_CCGR3 = F00FF303
 FLEXIO2_CTRL = 00000000
 FlexIO2 Config, param=02200808
 FLEXIO2_SHIFTCFG3 = 00030000
 FLEXIO2_SHIFTCTL3 = 02000401
 FLEXIO2_TIMCMP2 = 0000000F
 FLEXIO2_TIMCFG2 = 01206600
 FLEXIO2_TIMCTL2 = 18401003
SENSOR DETECTED :-) MODEL HM01B0
OSC_CLK_DIV: 0x29
ImageSize (w,h): 324, 244
Send the 'f' character to read a frame using FlexIO (changes hardware setup!)
Send the 'F' to start/stop continuous using FlexIO (changes hardware setup!)
Send the 'p' character to snapshot to PC on USB1
Send the 'b' character to save snapshot (BMP) to SD Card
Send the '1' character to blank the display
Send the 'z' character to send current screen BMP to SD
Send the 'V' character DMA to TFT async continueous  ...

Reading frame
Reading FlexIO frame.......................................
39370000 39393737 393a3a3b 3b3b3a39 3c3a3a3b 3639393c 35363536 35353435 35343636 36363536 37373837 3a393938 393a3a3a 3d3b3a3b 3f3d3d3c 403e3e3f 
40434240 363c3e42 30303033 302f2f2f 322f312f 31323133 32323233 37353433 433d3a37 8472634f 9694958e 62879496 3f3f4248 4a43413f 4c4c4a49 4f524e4e 
5c5a5555 786e685f 7f8b988f 74757678 6a6e7173 67646a6b 62626466 585a5c61 5f5c5b59 66615f5e 67686868 4d5a626b 42404345 48404140 ba9a6f54 e4ddd5c8 
e8e6e9e5 edefeff1 dbe2e0ed dedddedd dcdddfdc dedfe3de e5e4e2e4 e7e8e3e6 e9e6e9e6 e6e3e7e7 e4e3e7e8 e2e6e6e8 e4e4e6e9 e0e5e4e3 e1e5e1e5 dfdddde3 
dde1e6de b1b9c3d3 c4bbbeb2 b4bec0c1 9e9aa2ad 9f99959b 9c9d9fa6 938e9299 a59f9c9a 999ea1a1 9999999b 8e8e9295 8889898b 86828886 7b7e7e7f 76747777 
6e707172 6d6c0000 35360000 36353636 36363737 39383738 37373837 37363836 36363435 36383436 36373736 39383738 383a3a39 3c3c3b3b 3d3d3c3d 3d3c3d3d 
3f3e3f3e 3f414140 3b3e4141 30313538 30302f2f 31312f30 34323432 32323233 34323232 35353534 483f3b38 8a816f5d 96959293 4f748894 40403e42 4a484341 
4e4b4a4a 53545151 5d5c5756 80756a62 787c808a 73757475 6a6a6d6d 66666967 625f6467 595a5c60 6462605a 61626360 696a6867 47546164 3f404344 49423f3f 
9a897a5d d7d4c5b0 e3e5dfdc dbdce1e8 dbdad8d6 deddd9d8 dedededd dee0e1de e2e1e4e4 e6e6e8e5 eae4e5e6 e5e9eae5 e1e6e9e7 e3e5e4e6 e1e5e1e6 dedee4e4 
e0dfe2e2 e0e1e1e0 dee8e0e1 b6bcc4d4 c3c1bab9 b9bebec2 ada69eab 9c989ca7 a09e9a9b 9e999498 a3a69c9a a0a2a2a8 979c9b9e 9293949b 8c8c8d8e 8787888a 
7c7f7f80 72767979 6f727472 6d700000 31320000 32323132 33323233 36363534 39383636 37373936 37373637 38383738 38373938 3a3b3939 3d3b3b3a 3e3d3c3d 
3f3f3e3e 403f3e40 3f40403f 3d3f3e41 32333739 302f3132 30312f30 39353533 36393b3c 32323132 32333432 37353533 54453b3a 8e897d6a 91939192 485c7d8e 
3f3e4143 4c494841 4d4e4b4b 5550504d 615c5a57 857b7067 7674787b 6c6e7275 6868676a 65656669 5e5f6466 615e5c5b 67626261 65666567 65676666 454a5761 
3f404042 5246413f 8d868069 c8bca897 d9dbd8d7 d4d6d7d9 d6d9d7d3 dcdedbd9 e2e0dedc e3e4e0e1 e4e6e7e1 eaebe7ea e8eaeae7 e6e5e9ea ede9e9e8 e9e4e3e6 
e2eae6e8 e6e4e5e5 e8e7e7e7 e4e7e2e5 e0e5e3e4 b9bcc6d5 cabebfbc b9bfc3c4 b4aba4a2 9a9ea6af 9b9d9893 9b9d9998 a7a2a19a a6a7a6a8 999ea0a2 938f959a 
8e8e8f91 8687868b 807b8085 777a797d 72727674 6b6f0000 2f2e0000 302f302f 33333130 36363534 3a3a3937 39393939 3a393a39 3a393939 3b3b3c3a 3a3c3b3b 
Finished reading frame
 
I may need to wait until I can up LA to this to see what the data is... Sure wish I went into town :D

Paul, with your breakout board you are still feeding 3.3v to the camera? If so until then I may be able to rig up using the ribbon cable breakout and hook up to ATP as I do have two extra cameras now.

But would need to work out what goes to each pin... But that should be obvious from carrier board schematic.
 
Evening all

Just changed it and yeah getting different garbage but not skipping columns :) Looks like its close though. Just as a goof to save a screen shot I sent it to the Arducam App. Was a little surprised when I saw:
Capture.PNG

compared to what I see on the screen:
IMG-0361.png
 
Thought crossed my mind especially when I saw a nibble swap shiftbuffer register right after the timercfg register in the rm. have try in the morning to tell the camera to use lab first and try it that way. It’s either 3060 or 3059 for the camera
 
Good very early morning all

Well FlexIO4bit is actually working. Got up and turned the TMM on and voila image was perfect for FlexIO4bit. Haven't seen it in such a long time I forgot. But if you get an image like shown in previous post on the screen turn the TMM off. Let sit for a few minutes unpowered and turn back on. 90% of the time that cures the image problem.

Has nothing to do with nibble swap or any other change except form TIMCMP=15 for 4bit mode. BTW seems SHIFTNSBUFx was talked about before: https://forum.pjrc.com/threads/62362-VGA-out-for-Teensy-4-0-4-1.

I just pushed a minor change to the lib to take into the different setting for TIMCMP. That just leaves DMA4bit mode :)

Not sure what we need to do for the other suggested modes:
Code:
HM01B0_SPARKFUN_ML_CARRIER = 0,
	HM01B0_TEENSY_41_GPIO_8BIT,
	HM01B0_TEENSY_40_FLEXIO_1BIT,
	HM01B0_TEENSY_41_FLEXIO_4BIT,
Guess for T4 and T41 have the option to set different pins but that starts getting complicated - argh :(
 
Great news - and even better my desktop github is properly linked for once and I see the changes to get.

Are INO changes in progress?
 
No INO changes in progress - still using the last one posted, at least not for now. Getting ready to go back and get some more zzzz's.

There was one thing that was bothering me. The license for the Arducam repository with the Arducam app. Did check a bit ago and looks like it falls under the MIT license so now don't feel guilty about using :)
 
just did a quick edit for SerialUSB1 monitoring for 0x30 and sending on that to feed ArduCam while Serial is open for normal SerMon

See : mjs513/TMM-HB01B0-Camera/pull/19

Run with normal SerMon on Serial - when compiled DUAL/Triple - ArduCam can connect to 2nd USB1 port and capture images without tying up main Serial for DEBUG or other commands and blocking Upload as well.

>> Using PJRC.mm.B 8 bit HM camera mount::
_hmConfig 3 (GPIO4): works right on ST7789 and ArduCam
_hmConfig 4 (Flex4): Still has the bar lines on both
 
Last edited:
An hour plus later the "F" is still running.

I snapped a phone pic - which takes a 2 sec movie of images

Was cool because I have the flash forced on. Pics start flash off - the camera caught the board lighting - then the flash blinding the camera shows on the ili9341 as the light fades on the PCB, then the ili9341 image draws without the flash.

I trimmed the movie to 1 sec but still 1.93 MB from 4.44MB so can't upload.

Also cool as the 4" ribbon to the display reaches to the end standoffs on the base where the display is rotated same direction as camera laying on its side

And ArduCam Capture still working { on second USB Dual port } - some images are ill formed - but better than PDE - much faster for sure though some ill formed images come in groups
 
Back
Top