MicroMod Beta Testing

With the change that Kurt made to the 's' decided to see if the other frameSizes would work as well:
Code:
  /*
   * FRAMESIZE_INVALID = 0,
   * VGA Resolutions
   * FRAMESIZE_QQVGA,    // 160x120
   * FRAMESIZE_QVGA,     // 320x240
   * FRAMESIZE_320X320,  // 320x320
   */
to my pleasant surprise all three frame sizes worked whether the Sparkfun config was used or not. Just as a note - you do have to remember that if you use 320x320 you need to change the buffer sizes :)
 
Right now I'm using Sparkfun's ML carrier board with ILI9341 connected to the left side pins. Nothing special on the HM01B0 camera.
Thanks, was wondering if you somehow hooked up using the board you showed in the post: https://forum.pjrc.com/threads/66771-MicroMod-Beta-Testing?p=276171&viewfull=1#post276171
that you tried with Teensy 4.1

On the breakout board, which is still at least a week away, I put 2 camera connectors on the bottom side. One is wired for 4 bits with the signal names documented on the silkscreen. The other is wired for 8 bits exactly the same as Sparkfun's ML carrier. I also added the through-hole pads you wanted for the USB host signals.

View attachment 24417

4 bit mode uses only the high-numbered pins (29 and higher) so it doesn't conflict with I2S audio or any of the other stuff normally used with Teensy 4.0. Even if I get FlexIO working perfectly with 8 bits, I'm not going to touch 4 bit mode until these breakout boards arrive. But working or not, I will send a pull request tomorrow with my current FlexIO code for anyone who wants to see it.
Board looks great! Will be fun to see your flexIO.
 
A quick question - on your breakout board how did you handle the 1.8v power to the camera.

I just connected all 3 power pins to 3.3V.


Thanks, was wondering if you somehow hooked up using the board you showed in the post: https://forum.pjrc.com/threads/66771-MicroMod-Beta-Testing?p=276171&viewfull=1#post276171
that you tried with Teensy 4.1

That test board doesn't connect the video signals at all. They just route to those pads in the middle of the PCB. Only power and I2C are actually connected. All the Teensy 4.1 pins are also duplicated on another set of pads. The idea was to just solder or plug wires for experimenting with the video output signals.
 
Oh just one thing the 4pixels is a 2 pixel border around the actual 320x240 image.

Somehow I was under the impression we were keeping the first 320 pixels and discarding the last 4.

Just to confirm, on each line of 324 pixels, we're supposed to ignore the first 2 and last 2 pixels and keep the 320 in the middle, right?
 
That was the change from last night and this morning. So yes first 2 pixels and last 2 pixels.

Edit:
Kurt's original DMA code skipped the 1st 4 pixels and what I went to this morning was using the subwriteRect that centers the image so it would clip a 2 pixel border around the image. The new way just sets the origin at -2,-2 and makes use of the builtin clipping. But with the way we are doing it now we read in the whole 324x244 image and then manipulate it so we get correct display.
 
@KurtE
Looks like we are going to have to edit the ST7789 library to add in read8pp as well since I don't think it currently supports it.
 
Afternoon all (I think),

Been outside playing (Planting Peas...)

I have not fully resolved the DMA stuff yet.

FYI - I pushed up a WIP of my FlexIO test code... Will test out some of my Serial drivers on different pins using it.

Main thing this time was to update the tables (including the readme). But Screen shot of that portion on Github:
screenshot.jpg
I don't remember seeing any SELECT_INPUT like registers on the FLEXIO pins, but have been bit enough times when something is not getting the input when I think everything is correct.
 
@KurtE
Looks like we are going to have to edit the ST7789 library to add in read8pp as well since I don't think it currently supports it.
I have a version that builds with the writeRect8BPP (as well as 4 2 1 and N)


So may need to grab adafruit display and try it.
 
I have a version that builds with the writeRect8BPP (as well as 4 2 1 and N)


So may need to grab adafruit display and try it.

Just made the changes for 8 and 4 and was going to try out - should have known better :)

EDIT: Is it posted - I will give it a try
 
I have a version that builds with the writeRect8BPP (as well as 4 2 1 and N)


So may need to grab adafruit display and try it.

Just tested the mods I just made and it works :) You want me to push it to you or you can just use what you have - probably the same since I just copied it from ILI9341_t3n
 
I am playing with the DMA code some more. I put in new command 'f' - read in one frame using DMA and then output it...
It verified that the data in the frame is not coming back correctly. So digging some more.
 
I am playing with the DMA code some more. I put in new command 'f' - read in one frame using DMA and then output it...
It verified that the data in the frame is not coming back correctly. So digging some more.

Probably not the problem but wanted to ask. In the .h file
Code:
	enum {DMABUFFER_SIZE=1280};  // 640x480  so 640*2*2

the 1280 probably needs to be changed to 324*2*2 = 1296
 
I updated to the latest TMM-HB01B0-Camera from github, in prep to clean up my flexio stuff, but it seems I no longer get a working image from either "s" or DMA. I'll admit, I fell behind on the forum these last couple days while fiddling with flexio timers. Do I need a special version of ILI9341_t3n or something else?


EDIT: Ah, ok, I see now that I need to use the "hm01b0_testv2" example. I was still running the original "hm01b0_test" example, which no longer gives a proper image.
 
I updated to the latest TMM-HB01B0-Camera from github, in prep to clean up my flexio stuff, but it seems I no longer get a working image from either "s" or DMA. I'll admit, I fell behind on the forum these last couple days while fiddling with flexio timers. Do I need a special version of ILI9341_t3n or something else?

Should just need ILI9341_t3n library. 's' is pretty standard and seems to have always worked. The latest TMM-HB01B0-Camera is set up for 324x224 but 's' works for Sparkfun or non-Sparkfun configs.

I know every once in a while I have to turn power off to the camera on the power strip (usually a couple of minutes) and then reload the sketch. After that it works.

EDIT: Note DMA seems to be having issues right now but 's' and 'c' work. Same with the PDE and saving to SD card.
 
I updated to the latest TMM-HB01B0-Camera from github, in prep to clean up my flexio stuff, but it seems I no longer get a working image from either "s" or DMA. I'll admit, I fell behind on the forum these last couple days while fiddling with flexio timers. Do I need a special version of ILI9341_t3n or something else?


EDIT: Ah, ok, I see now that I need to use the "hm01b0_testv2" example. I was still running the original "hm01b0_test" example, which no longer gives a proper image.

Was just about to post - but the other one should have worked as well. Going to delete it - probably easier that figuring out the differences.
 
Ok, I just sent a pull request with initial FlexIO. No DMA yet, but it should be fairly "easy" to just set up a DMA transfer which reads from that FlexIO register and writes to the buffer.
 
Ok, I just sent a pull request with initial FlexIO. No DMA yet, but it should be fairly "easy" to just set up a DMA transfer which reads from that FlexIO register and writes to the buffer.

@all - Paul - I got github to merge your changes into mine that was in sync with @mjs513
>> Changed to using ILI9341_t3n

THIS WORKS !!! >> 'f' : read a frame using FlexIO (changes hardware setup!)
<edit> : it now works without using SPARKFUN mode here : turning that back OFF allows reset/Upload without issue on the restart and no POWER cycle required!
Ignore this if not 'SPARKFUN defined' > - EXCEPT >> 'f' :: GOOD, Reset or UPLOAD , 'f' :: BAD > The color shading tends to BLACK with few lighted pixels - requires Power Off restart ???
- As Paul noted on 'command line' : once you go FLEX you can't go back to 's' or 'c' or 'p'!

Before doing 'f' the prior 's' and 'c' work! But like last sync the 'd' for DMA is now all torn and failing. Not sure if 'p' works before?

BACK to FLEXIO at images :: Frame Update using FlexIO @11 fps

I added 'F' for FlexIO Continuous: Send the 'F' to start/stop continuous using FlexIO (changes hardware setup!)
Code:
Reading frame using FlexIO
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 = 00070000
 FLEXIO2_SHIFTCTL3 = 02000401
 FLEXIO2_TIMCMP2 = 00000007
 FLEXIO2_TIMCFG2 = 01206600
 FLEXIO2_TIMCTL2 = 18401003
Finished reading frame
Frame Update using FlexIO @12 fps
[B]Frame Update using FlexIO @11 fps[/B]
Frame Update using FlexIO @11 fps

I'll see about making more changes - but for now :: View attachment hm01b0_testv2.ino < updated code in p#373
 
Last edited:
Frame Update using FlexIO @31 fps

Quick UPDATE :: Frame Update using FlexIO @31 fps
<edit>: Ran 1 hour since posting and still running no issue at 31 fps.

with : #define TFT_ILI9341 1 for >> "ILI9341_t3n.h"

and this in 'F' : tft.useFrameBuffer(true);

and this edit:
Code:
  if ( g_continuous_flex_mode )
   {
      cFlex++;
      if ( tFlex > 1000 ) {
        Serial.print("Frame Update using FlexIO @");
        Serial.print(cFlex);
        Serial.println(" fps");
        tFlex=0;
        cFlex=0;
      }
      memset((uint8_t*)frameBuffer, 0, sizeof(frameBuffer));
      hm01b0.set_mode(HIMAX_MODE_STREAMING_NFRAMES, 1);
      hm01b0.readFrameFlexIO(frameBuffer);
      for(int i = 0; i < FRAME_HEIGHT*FRAME_WIDTH; i++) {
        imageBuffer[i] = color565(frameBuffer[i], frameBuffer[i], frameBuffer[i]);
      }
      tft.writeSubImageRect(0, 0, tft.width(), tft.height(),  (FRAME_WIDTH - tft.width()) / 2, (FRAME_HEIGHT - tft.height()), FRAME_WIDTH, FRAME_HEIGHT, imageBuffer);
      [B]tft.updateScreenAsync();[/B]
    }

NOTE: There was a MINOR bit of image shifting on first run - did Re-Upload and Re-Power - image is now STABLE and RIGHT at 31 fps! - just a bit of redraw pulsing
 
Last edited:
Final Note before Zzz's: with > //#define USE_SPARKFUN 1 :: It works here now for 'c' and 's'. And image is brighter.
>> ALSO it works across code upload or T.MM Reset (TyComm) { edited above post }

I put the timer code on the NON-FlexIO and it also runs at 11 fps with wait for screen update
> Using Async the picture rolls and the update is 30 fps.

Some (rare) restarts with using Async ILI9341 and 'F' FlexIO continuous scroll/tear - that seems a timing race issue with the buffer update.

Adding waitUpdateAsyncComplete(); slows it down to 23 fps and results in horrible unusable images.

Code:
Current working non_SFUN version with fps timing : [ATTACH]24421._xfImport[/ATTACH]
 
Morning All

Merged the changes into the github repository and just start playing but my display is acting up - wire connections with jumpers Argh!

Anyway ran 'f'lexio using Sparkfun and non-sparkfun configs. Both worked no problems for me. Image quality looked about the same from my end but going to do some more testing once I get the display sorted out. Did run at framerates (30 and 60).

BTW I did notice that I have the load QVGA settings outside the "if" for the config - this actually runs the sparkfun config at 30fps up from the 5fps.

Ok = now need massive amounts of coffee and try and finish waking up
 
@Paul - @KurtE - @defragster
Did a couple more tests with FlexIO.
Test 1: Tried changing the frameRate from 30fps to 60fps. At 30 "F" (flexIO continuous) using @defragster's updated sketch, runs fine picture quality good, however, when I change it to 60fps continuous seems to start degrading, i.e, out of synch.

I did notice that the calculated frame rate stayed at 31fps. So guess is that flexIO is controlled by the flexio frequency (120Mhz) more leading to a fixed frame rate of 30fps.

Test2: the sketch has an option to blank the screen, case '0' but when I hit it, no changes - have to check the updated sketch.

Haven't tested the other functions yet.

QUESTION> Since we are moving to flexIO going to setup init to have a couple more default settings - framerate fixed at 30.

Test 3: Here are 2 images save to the sd card using non-Flex and FlexIO:
View attachment 9px_0000.bmp View attachment 9px_0001.bmp
 
Last edited:
Back
Top