Teensy MicroMod

Rezo, I am curious what hardware you are using to prototype this. Are you using one of the ILI948x displays with a flex cable (and adapter) to get to the displays parallel IO? Also, are you using the Teensy MM with a Sparkfun Carrier board or did you make your own carrier PCB similar to what KurtE did?

Exciting stuff. Getting an update rate of 40-50 frame/sec on these low cost displays would be great! Nice work.
 
When I was writing the library I was using a Sparkfun MicroMod ATP board with an Arduino ILI9486 shield that I purchased on Amazon. It is an 8 bit parallel breakout display board.
Here is a video of it after I got it running for the first time - https://youtu.be/Q09EmoaI_C8

I also have a custom PCB with a MicroMod carrier and an FPC connector for a bare display (ILI9488) sourced from AliExpress. It has CAN bus running on it as it’s a vehicle application.
Here is a video of my LVGL app with an older version of my custom hardware - https://youtu.be/vtQaaXoaV7s
 
I am planning a custom PCB using MM, FPC and a bare display as well. Any chance you could share the portion of your schematic that shows the MM/parallel display/USB/USB host design? I am using the Sparkfun carrier PCB and the schematic that KurtE posted so far for the MM specific stuff. The parallel interconnection would really be helpful.
 
@Neal I only use the display, CAN, USB, I2C and planning for SDIO in the future.
MM_LCD_FLEXIO2.png
This is the pinout I've used for the various peripherals. Note that the pin numbers are MicroMod pins and not Teensy pins. You can refer to this document on KurtE's git for the mapping between the MicroMod connector and the Teensy pins
 
Rezo-thanks for the information. I see that your parallel hookup is what I expected.
 
@Neal note that WR and RD pins can be wired to alternate FlexIO2 pins that are available, but they will need to be changed within the library code.
 
Thanks for pointing that out.

For this prototype I am laying things out so I can choose with jumpers to either run SPI of 8bit parallel. I see where you are setting the WR pin in FlexIO_Init(). I am not as FLEXIO savvy as I am sure you are, so I initially plan on using the same pin you selected for WR.

If you see any obvious flaws in the selectable interface mode I mentioned above, please let me know.

BTW, nice work on this parallel IO stuff.
 
Rezo-Sorry, one more question. I have a touch screen in my application. If I am using the parallel interface DMA FlexIO2 (pin55) to the display, am I correct in assuming I can use the SPI(4) pins 57, 59 and 61 to communicate with a touch chip and that it would not interfere with parallel output to the display? Or is that why you mentioned the need to possibly change to alternate FlexIO2 pins?
 
KurtE-The teensy 4.0 schematic shows the SD card DAT3/SD_B0_05 and the DAT2/SD_B0_04. I think your spreadsheet shows DAT3/SD_B0_04 and DAT2/SD_B0_05 with the names reversed? Not sure, but I thought I would point it out.
 
Rezo-Sorry, one more question. I have a touch screen in my application. If I am using the parallel interface DMA FlexIO2 (pin55) to the display, am I correct in assuming I can use the SPI(4) pins 57, 59 and 61 to communicate with a touch chip and that it would not interfere with parallel output to the display? Or is that why you mentioned the need to possibly change to alternate FlexIO2 pins?
You can either use a different set of FlexIO pins for WR/RD (you can use MM pins 56/54 which is Teensy pins 7&8 which is FlexIO2:16,17) or you could use any other set of SPI pins available such as SPI1 alt 3 on MM pins 19, 17, 68 and 8.
 
I just wanted to confirm that the Sparkfun Teensy MicroMod board is a Teensy 4.0 for the purposes of software development. The Sparkfun documentation is poor, and they do not respond to technical questions. I'm assuming that even though their documentation doesn't mention for example all 7 serial ports, they are still accessible in software on their equivalent IO pin. For example their pin labelled I2C_SDA1 is also D25 and A8 and RX6 and SDA2 in the Teensy development world.

I assume that select the Teensy MicroMod in the Arduino Boards Manager will bring all of the equivalent functions alive on the MicroMod that the Teensy 4.0 has.
 
I just wanted to confirm that the Sparkfun Teensy MicroMod board is a Teensy 4.0 for the purposes of software development. The Sparkfun documentation is poor, and they do not respond to technical questions. I'm assuming that even though their documentation doesn't mention for example all 7 serial ports, they are still accessible in software on their equivalent IO pin. For example their pin labelled I2C_SDA1 is also D25 and A8 and RX6 and SDA2 in the Teensy development world.

I assume that select the Teensy MicroMod in the Arduino Boards Manager will bring all of the equivalent functions alive on the MicroMod that the Teensy 4.0 has.
The MicroMod is not exactly like a T4 or T4.1 but is related to both. That is they have all have a lot of common pins, especially in the lower pin numbers, but in higher ones they are all different.

I keep my own excel document with some different pages on the MMOD as well as the other T4.x boards on what each pin is. For example
Screenshot.jpg

And another page:
Screenshot2.jpg

Note: warning there could still be some issues with my pages. I have not used their carrier boards very much lately. I have my own, which uses Teensy pin numbers on it.
 
Kurt, thanks so much. That's brilliant. I had started on something similar. Is it possible you could share the .xlsx file?

It would be great if PJRC could release a Teensy 4.1 equivalent with a high density connector that lends itself to SMT assembly. Something better supported and better designed than the MicroMod. The proto-style 0.1" headers are fine for hackers and newbies, but we never do anything these days without cutting a PCB, and its time for a new format for the Teensy. Some of our Teensy projects are produced in small volumes for business purposes and the current form factor is a bit archaic.

David
 
@Ausplex.
The MM is a Much better form factor for customer products.
But if you’re looking for smaller footprint and more pins - it’s time to go for a fully customized pcb with the bootloader from
PJRC.
I’m building a hybrid between the 4.1 and an MM - PSRAM, 32 FlexIO/LCD pins and the rest of the standard pins
 
We like the the Teensy concept for low volumes as its much quicker to get a product out without having to place a large pin-count BGA. I'm going to do my first board using the MicroMod and see how well it works for us.
David
 
Be aware that there are problems with the MicroMod longevity.
It seems like the board flexes and the BGA loses contact between the board/chip.
 
That's alarming. Was this a one-time experience or is this a common problem?

Fabricating PCB's with high density BGA chips is problematic at the best of times, and without X-ray inspection equipment it is very difficult to establish if the production process its reliable. I wonder if Sparkfun have the right experience to do this.
 
See here. There has also been much discussion about the problem on this forum, but at the moment I am unable to finds it.
 
I received my SparkFun MicroMod ATP Carrier Board & MicroMod Teensy Processor today. Concentrating on simple things first, since the ATP Carrier includes an RTC battery, I attempted to set the Teensy MM RTC. To do so, I am running the standard (unmodified) DS1307RTC example SetTime:

Code:
#include <Wire.h>
#include <TimeLib.h>
#include <DS1307RTC.h>

const char *monthName[12] = {
   "Jan", "Feb", "Mar", "Apr", "May", "Jun",
   "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};

tmElements_t tm;

void setup() {
   bool parse = false;
   bool config = false;

   // get the date and time the compiler was run
   if (getDate(__DATE__) && getTime(__TIME__)) {
      parse = true;
      // and configure the RTC with this info
      if (RTC.write(tm)) {
         config = true;
      } else {
         Serial.println("Failure writing RTC...");
      }
   }

   Serial.begin(9600);
   while (!Serial) ; // wait for Arduino Serial Monitor
   delay(200);
   if (parse && config) {
      Serial.print("DS1307 configured Time=");
      Serial.print(__TIME__);
      Serial.print(", Date=");
      Serial.println(__DATE__);
   } else if (parse) {
      Serial.println("DS1307 Communication Error :-{");
      Serial.println("Please check your circuitry");
   } else {
      Serial.print("Could not parse info from the compiler, Time=\"");
      Serial.print(__TIME__);
      Serial.print("\", Date=\"");
      Serial.print(__DATE__);
      Serial.println("\"");
   }
}

void loop() {
}

bool getTime(const char *str)
{
   int Hour, Min, Sec;

   if (sscanf(str, "%d:%d:%d", &Hour, &Min, &Sec) != 3) return false;
   tm.Hour = Hour;
   tm.Minute = Min;
   tm.Second = Sec;
   return true;
}

bool getDate(const char *str)
{
   char Month[12];
   int Day, Year;
   uint8_t monthIndex;

   if (sscanf(str, "%s %d %d", Month, &Day, &Year) != 3) return false;
   for (monthIndex = 0; monthIndex < 12; monthIndex++) {
      if (strcmp(Month, monthName[monthIndex]) == 0) break;
   }
   if (monthIndex >= 12) return false;
   tm.Day = Day;
   tm.Month = monthIndex + 1;
   tm.Year = CalendarYrToTm(Year);
   return true;
}

Running this example reports the following failure:

Code:
DS1307 Communication Error :-{
Please check your circuitry

So, just to make sure that I'm not making too many wrong assumptions:

1) is the RTC battery on the SparkFun MicroMod ATP Carrier Board connected to the MicroMod Teensy RTC ??

2) is the standard DS1307RTC SetTime example the proper way to set the Teensy MM RTC & should this work ??

Thanks in advance for any advice/insights/clarifications !!

Mark J Culross
KD5RXT
 
I get that error too - but there is no DS1307 in the system.

I just got a new T_MM and ATP since they were on sale and filled my cart for free shipping.

There is an example in the TIME (?) area that works?

Can look again later. This DS1307 came up recently and seems I posted a link to that sketch that worked.

I'm wondering if that is a BATTERY or a CAP? Also in that order were two TIME boards that have a CAP that will run the timer chip over a month - and it is about that size and SOLDERED on as well. If the ATP has a battery - it would be dead? ANd soldered can't be changed.

Glanced the other day and didn't see it called out for what it is ???
 
Last edited:
Confirming T_MM on ATP works with that sketch.

It builds and runs, unplugging and plugging back in comes up showing the time. Unplugged twice, once over a minute:
Code:
20:26:33 16 12 2022
20:26:34 16 12 2022
RTC has set the system time
20:27:44 16 12 2022
20:27:45 16 12 2022
 
Last edited:
Tim (@defragster):

Thanks for that golden nugget of info !!

Initially, I didn't read your message close enough & I tried to use the code posted earlier in that other thread (from BriComp's "please post between code tags" post . . . always a good recommendation/reminder to new posters). However, I snipped only the setup() & loop() contents, rather than the whole enchilada. My Teensy MM went into a boot loop (crashing) !!

The sample code was so simple, so I must have done something really silly !! In an attempt to troubleshoot, I added the typical CrashReport mechanism as follows:

Code:
   if (CrashReport) {
      Serial.print(CrashReport);
   }

Unfortunately, CrashReport was not printing anything with each reboot !! I fiddled with this for a few minutes before I finally found the actual cause. Here's a short example that you might wish to investigate, if you have an interest in figuring out why CrashReport fails to print anything:

Code:
#include <Wire.h>
#include <DS1307RTC.h>

void setup() {
   unsigned long check_time = millis();

   Serial.begin(9600);
   while (!Serial && ((millis() - check_time) < 3000));

   if (CrashReport) {
      Serial.print(CrashReport);
   }
}

void loop() {}

If you simply comment out the "#include <Wire.h>" line, the Teensy MM will boot loop & CrashReport will fail to print anything . . .

Thanks again for your help with the Teensy MM RTC . . . I got it working with the "TimeTeensy3.ino" sketch that you pointed me to & appreciate your assistance !!

Mark J Culross
KD5RXT

P.S. After (re)adding the "#include <Wire.h>" line correctly, the very first boot after reprogramming indicated that the crash was a result of a NULL pointer exception as follows:

Code:
CrashReport:
  A problem occurred at (system time) 13:49:27
  Code was executing from address 0x6000176E
  CFSR: 82
	(DACCVIOL) Data Access Violation
	(MMARVALID) Accessed Address: 0x0 (nullptr)
	  Check code at 0x6000176E - very likely a bug!
	  Run "addr2line -e mysketch.ino.elf 0x6000176E" for filename & line number.
  Temperature inside the chip was 46.83 °C
  Startup CPU clock speed is 600MHz
 
Back
Top