Senior Design Project Feasibility

maxipad640

New member
I'm currently working on senior design project involving the teensy 4.1, my current design utilizes a couple i2c and SPI interfaces to collect data from different chips as well as transmits the data over UART to another computer. My instructor wants me to rewrite my implementation without using the prebuilt Arduino and Teensy libraries such as Wire.h and so on. My question is, is it a realistic expectation to reimplement these functions by studying the IMX RT1060 data sheet and figuring out how to configure all the different configuration pins correctly in a 2 month period? I've done similar microcontroller configuration with an STM32, however this chip seems far more complex. Just wanting general advice if I am in over my head.
 
@maxipad640:

I would admit that, yes, you could probably bit-bang I2C & SPI interfaces as part of your senior design project. However, doing so would require a great deal of in-depth detailed hardware knowledge & very likely, many hours spent poring over hardware manuals underlying the Teensy family of products. I would argue that, in current project activities, hardly anyone "re-invents the wheel" like this, with exception of those folks who desire to better understand what goes on under the covers, purely for their own educational purposes.

Using existing libraries has many advantages, some of which are as follows: a) someone else has already spent the time poring over the hardware manuals in order to fully understand the necessary implementation of the library, b) someone else has provided tested, working (very likely bug-free) support thru these libraries, c) many other users have used these libraries, standing up a large base of verified operations making use of these libraries.

if, instead, you were to implement your own replacement(s) for these libraries, even with your prior STM32 experience as you mentioned, your success is heavily dependent upon your correct interpretation & understanding of the hardware manuals. I would predict that your implementation is much more likely to suffer from unknown & difficult to troubleshoot software bugs. I don't know what else you have to accomplish on your project, but a 2-month schedule leaves hardly any time for wrestling with non-working code. Your ultimate success is much more likely if you are allowed to use existing library support.

I would suggest that you politely & diplomatically inquire with your instructor as to the intention(s) behind his request that you "roll your own". If it is as simple as "you need to fully understand how things work", my humble opinion is that your time would be far better spent studying the existing library capabilities, & then writing a detailed analysis of how it accomplishes its intended purpose.

Hope that helps & best of luck on your project . . .

Mark J Culross
KD5RXT
 
I guess, part of the task is to demonstrate how these interfaces work. What I would do is to take your STM32 implementation as API template and study/use the Teensy implementations together with the IMRXT datasheet and fill your API. It can be done, it has been done, I did it (OK for Teensy 3.x and not 4.x). BTW, you will realise, that the Teensy libraries could sometimes simplified when dealing with specific allications, simplifying the task.
 
I understand why you'd be asked to do this: it gives you a MUCH better understanding of how the hardware works and how to do low-level programming. Sure it's entirely possible for you to write your own I2C and SPI drivers for the Teensy hardware. You don't need to get super fancy. Just initialize hardware and do simple sending and receiving. You can avoid DMA based transfers and the other complex topics. Such a driver would be possible to do in 2 months. For one, you can "peek" at the existing drivers to figure out what sort of things you need to do.
 
In the span of 2 months, I'd say writing a SPI or I2C or Serial driver from scratch is probably do-able. But doing SPI and I2C and Serial (all 3) is probably unrealistic.

How sophisticated your driver ends up can really vary depending on your skill level and how much time you're able to dedicate to the project, and also to some degree random luck whether you do or don't hit various time-consuming problems.

So my general advice would be to negotiate with your instructor about the project expectations. Ask if they'll accept you writing 1 driver rather than all 3, perhaps use the built in libraries for the other 2 as part of a demo (which you'll also write) to prove your new driver really works in practice.
 
Back
Top