Books specifically for Teensy IC?

Status
Not open for further replies.

deelaleo

Well-known member
I have found nothing so far; only the data sheet on this site and the tutorials here. There are plenty of books for Arduino, but Teensy != Arduino, so I do't want to waste time reading a book that is only related to the Teensy.

What would you suggest to learn about Teensy 3.1? I did the tutorials, but many concepts are just abstract to me; since I did not study electronics in college...just did basic courses ages ago about the physics behind electronics.
I believe that any book that actually teach stuff like I2C protocol and such is a good reading...altho I found none that address specifically the Cortex-M4, so without the example I am left with the theory...and I know the theory of how they work in principle. What I lack is step to step examples that teach me how to achieve X or Y, with code (I learn by doing; unless it is a purely mental subject, like Physics or Chemistry).

Also I would like to know if there is any advantage in ditching the Teensyduino environment, and write code directly in C++ and then compile it and upload it on the Teensy?
I heard of people just writing code for the Cortex-M4; but I don't see any tutorial around. Maybe it is not worth to do so, and it is better to just write code via Teensyduino?

I feel like it is better if I learn some more, before just do stuff without really understand what am I doing :)
 
What projects make you say, "Gee, I wish I could do that!" You've told us your background isn't electronics, but where are you starting from? Are you interest in learning how to use resistors, diodes, capacitors, inductors, and transistors? Are you interested in designing your own circuit boards? Would you rather not bother with lower level stuff if you can avoid it? I.e. buy modules, use time-tested libraries and get on with the business of making something work? Would you rather get to the bottom of something like I2C no matter how long it takes? Would you spend money on tools like a logic analyzer, oscilloscope, or JTAG debugger?

There is a book on the Cortex-M4. You might even find a PDF online. There's the ARM Cortex-M4 Devices Generic User Guide. On pjrc.com there are some datasheets--don't let the term fool you. These "datasheets" are big reference books.

Hard to know what to recommend without knowing more about you and your goals.
 
Fair enough; your remarks are all legit and logic. Thanks for your reply.

Overall any project makes me think "how do I do that", but not because I don't know how to load a sketch or put together a circuit that I see on a diagram, but because I do not understand what is going on, besides that power goes into the teensy; something happens in the Cortex; a signal is sent to the GPIO pins and the attached entity respond in a specific way (a LED turn on, a relay switch; a sensor measure something, a transmitter transmit and so on).

I am trying to learn the basics, so when someone tell me "don't connect directly a sensor to the digital IO pins" I may understand why the signal are different, besides the basic that 5V and 3.3V are bad, if the higher voltage goes on units that works on lower voltage. Also I want to learn what is the difference between a dedicated pin for I2C, versus connecting only the clock of I2C and use the regular pins to address various sensors. This is just to give some brief examples about what I am trying to learn.

I started from the basics of physics: resistor, electricity, current, power and capacitors. I did simple circuits at school and now I am learning how to use MC to create new devices.

The ideal would be to be able to design devices, that are able to solve one or more problem. Or that can measure something, handle data parsing and elaborate it maybe (this can be done also by a computer); so the basic communication rules and protocols. I am a bit knowledgeable of how to put resistors to make pull up or pull down; how to make a current divider and such; the rest is all in my "todo" list, since I started recently and I spend very little time on this subject, since I have practically few hours a month to do any project. I would like to design circuit boards; but I am happy even if I can make what I need with just wires soldered on the board and such.
I have a master in Biology; I know programming since it is my actual job, so mostly my interest is in put together "pieces" and work on the code that can make them do something. I believe that with my knowledge, I can't really design any complex device, beyond using pre-made breakout boards.

I do not know how to operate neither a JTAG debugger or an oscilloscope; at the moment is not needed but down the road, I would love to learn how you use it to troubleshoot issues. I know how to use a multimeter for basic troubleshooting, and I know a bit of kernel base code that allow me to have a bit of experience with how drivers works at low level; altho I prefer high level languages, like C++ where possible.

In fewer words; I would like to learn how to put together devices, using the various IC breakout on the market; how to use correctly a MC; how to write correctly the code to make them work. Where possible I would like to write libraries, to support sensors and streamline basic operation, so nobody has to re-invent the wheel every time.

I will start with what you suggested; thanks again.
 
I'd say you've got enough of the basics to learn by doing. You're far enough along that if you decide to recreate someone's project you'll take the time to learn why things work along the way. Many of the questions you've got are explained in exquisite detail on this forum and elsewhere on the web. For example, how to protect digital I/Os.

There are a fair number of "hacks" posted on the web with enough detail that you can start filling in your learning todo list. A few of the usual suspects:


I'm sure others here have their favorites as well. I'm finding that it always seems like there's this unimaginable chasm between what's so easy I take it for granted and what the experts do. If I look back though, I can see that some of the stuff that's now so easy used to be in that other category.
 
As pictographer mentioned I'd start with a project that sparks your interest. Stick with the Arduino IDE and the Teensyduino Plugin for the first projects. The strength of that combination is not in the IDE but in all the libraries that allow you to realize a project without you having to dig too de deep into mircocotroller specifics.
The learning sets in when things don't work and you have to find out why! Knowledge gained this way really sticks. In my experience there are no shortcuts for this ;-)

As your background is in programming I'd imagine that you get frustrated quickly with the Arduino IDE. However, there are several much better Alternaives available that allow you to still use all the libraries without the shortcomings of the Arduino IDE. Speaking for myself I can say that I did learn much more about what is going on under the hood when I started using the Eclipse Arduino Plugin/IDE. There are several other alternatives!

A very valuable resource that I have not seen mentioned often are the various application notes for given components. I've found these to be extremely valuable resources, as they are often a compendium of real application knowledge and pitfalls for a given problem with a component. These are usually available online for free!
 
Last edited:
Thanks to both of you. Much appreciated for the resources; I know some, but others are totally new to me.

With programming, they usually have books that start with theory and go trough various useful and real-life scenario, so you end up with a piece of software that does in fact something, beyond the plain implementation of a concept or procedure.

With electronics there are some similar ones, altho it is harder to follow them , since they go for the usual LED or sensor that just read a value and that's all....I was looking for something that actually teach the logic behind choices about bus, processor, sensor type; and how to build the whole thing, so it does something useful, beyond the simple contraption that read a value from a pin or 2. Found something at the local public library, although they go very deep in details, which is on the other side of the spectrum for me :) I don't want to become an electronic engineer, I just want to know what I need to, to apply concepts and make choices (and mistakes are planned already). I agree that knowledge made trough attempts, is what sticks better; and hopefully, while I do my projects, I will be able to find quickly the solutions, because I dearly dislike that feeling of total clueless and powerless feeling, that follow an unsuccessful action. When you don't know what is wrong; is kinda hard to find a solution to it :)

Arduino IDE is cool, but I miss autocomplete, mostly. I miss the fact that there is a help in line, and so many other things. I was not aware that there is a plugin for Eclipse; I use that sometimes (I am mostly on either Xcode or VS; sometimes on Mono), and it would be interesting to use it...I will take a look at it, thanks!

What do you mean by "application notes" ? You mean the comments in the code for a specific IC? I enjoy a lot when a person does a post-mortem; so I can learn from his/her mistakes and get a spark to implement the same solution in a different way. Collaborative process always works better than the lone wolf; that's why we are a social living being :)
 
From time to time we try to remind Paul of the need for a good wiki. Join us!

I don't think there can ever be a reasonable book about the teensy (whichever version we might pick doesn't matter) because the only thing that doesn't change is the hardware, and that is covered with schematics and datasheets. There are, for example, books about AVRs and almot all of them describe old, probably outdated chips - transfering the knowledge to a new chip that is at hand is then a matter of reading two datasheets in order to find out the differences and how to make sense of them.

That said, what's left now is the software side: The arduino interface, how it's supposed to be used, the ideas behind it, and maybe teensy-specific extensions we publish as libraries. Both the arduino interface and the libraries change at their own pace, definitely faster than the teensy changes. Some things tend to remain as they are, though, and that is where you can start. Look at simple example sketches from the teensy website or from the arduino universe, and you will see how they are structured into setup() and loop() parts. That structure is a key element of almost every embedded program, it's just spelled out here in terms of function calls. But we all did that even before arduino came up - it's just common practice. You are looking for these basic rules and structures, and they are in no book I know of; they are a collection of basic rules from a number of disciplines that range from "don't create shortcuts between I/O pins" to "you shouldn't overload operators in non-obvious ways".

You're in luck, because you already know C++. Arduino is just some syntactic sugar-fat-mixture on top of that. It comes with some easy to use utilities (for example digitalWrite and its relatives), but also with some cruel bullshit like macros for 8-bit bitvalues, essentially blowing up templates (yes, you can use them, it's C++!) that have parameters like <B1>. Some boost libraries pick those names.

So, you definitely need a goal that you can split into smaller problems to tackle. Do you have such a goal? If you don't, you probably just bought a teensy because it's cool (that's absolutely fine), but that makes it a bit harder for us to get you started and help you. We're a faster community than that in the arduino forums, because we are more focused on teensys and have a higher ratio of "developers" vs "users".

I'll just stop now, just tell us what you have in mind. There are a lot of biology-related projects on hackaday.io, and sparkfun and adafruit usually publish libraries and example along with the hardware (sensors, displays, ...) they sell.
 
Let me explain on an example what an Application Note is. I needed to extend the I2C bus to cover +10ft while maintaining a 1MHz bus frequency. I picked the PCA9600 I2C bus buffer from NXP. The Data Sheet explains several configurations, but does not go int too much detail in respect to long I2C bus distances.
However, Application Note AN10658 filled that very application specific void perfectly.

Also, as you are already familiar with xCode you may want to check into embedXcode
 
Last edited:
I've only skimmed the responses so far, but from what I read of OP, i don't see why anyone hasn't mentioned that arduino books are totally relevant for teensy.

Yes, teensy is different. But, no, "Arduino Cookbook" is still an *excellent* beginners primer for the light combination of electrical, programming, and practical knowledge needed for these sort of MCU projects.
 
FWIW I'll share my learning path...

Last December I learned what an Arduino was for the first time. Today I am designing and assembling my own shields for the Teensy and Edison and writing code to make the sensors, EEPROMs, clocks, etc. work by reading and using the info on the available data sheets and App Notes. My best advice to a newbie wannabe is:

Study and practice the Sparkfun tutorials.

They have tutorials from the most basic "make an LED blink" to "how to use EAGLE" to how to solder 0.4-mm pitch LGA smd chips by hand. This is all time well spent, it's free, and better then any book or wiki for very rapidly gaining the necessary experience to get where it sounds like you want to go.

Oh, of course you have to "do" also, and make lots of mistakes. An expert is someone who has already made all the mistakes one can make in his/her chosen field. So get doing and make as many mistakes as you can as fast as you can!
 
From time to time we try to remind Paul of the need for a good wiki. Join us!

I don't think there can ever be a reasonable book about the teensy (whichever version we might pick doesn't matter) because the only thing that doesn't change is the hardware, and that is covered with schematics and datasheets. There are, for example, books about AVRs and almot all of them describe old, probably outdated chips - transfering the knowledge to a new chip that is at hand is then a matter of reading two datasheets in order to find out the differences and how to make sense of them.

That said, what's left now is the software side: The arduino interface, how it's supposed to be used, the ideas behind it, and maybe teensy-specific extensions we publish as libraries. Both the arduino interface and the libraries change at their own pace, definitely faster than the teensy changes. Some things tend to remain as they are, though, and that is where you can start. Look at simple example sketches from the teensy website or from the arduino universe, and you will see how they are structured into setup() and loop() parts. That structure is a key element of almost every embedded program, it's just spelled out here in terms of function calls. But we all did that even before arduino came up - it's just common practice. You are looking for these basic rules and structures, and they are in no book I know of; they are a collection of basic rules from a number of disciplines that range from "don't create shortcuts between I/O pins" to "you shouldn't overload operators in non-obvious ways".

You're in luck, because you already know C++. Arduino is just some syntactic sugar-fat-mixture on top of that. It comes with some easy to use utilities (for example digitalWrite and its relatives), but also with some cruel bullshit like macros for 8-bit bitvalues, essentially blowing up templates (yes, you can use them, it's C++!) that have parameters like <B1>. Some boost libraries pick those names.

So, you definitely need a goal that you can split into smaller problems to tackle. Do you have such a goal? If you don't, you probably just bought a teensy because it's cool (that's absolutely fine), but that makes it a bit harder for us to get you started and help you. We're a faster community than that in the arduino forums, because we are more focused on teensys and have a higher ratio of "developers" vs "users".

I'll just stop now, just tell us what you have in mind. There are a lot of biology-related projects on hackaday.io, and sparkfun and adafruit usually publish libraries and example along with the hardware (sensors, displays, ...) they sell.

I would gladly participate :) Since I know very little, would be a great chance to learn something too while I work on the wiki :)

Honestly I bought a teensy after learning about arduino....it looks too big to me, and also has limited number of IO; so when I discovered the teensy I told myself that it is cool to learn MC starting with it. The downside of such power in a small form factor, is that the learning process is less streamlined than the Arduino counterpart.

I would like to learn mostly how to use it to pilot sensor and do calculation...to then return the data to the computer. I believe 70% of the total electronic applications can fit in this category, so I am learning a useful skill that may be valuable also on the workplace. Ideally I would like to hook up the Teensy to my Mac or Pc, and write C++ code on Visual studio (or Mono on Mac), and then compile and update the Teensy and be good to go. So far the only way that I learned is via the Arduino IDE; which is cool to write simple stuff, but for a class based application with many moving parts; it is a bit too simple IMO.

I work often with equipment in the lab that does any kind of measurements; and I understand that I can't do what a 40K machine does, just buying sensors and a MC, but I want to learn as much as possible, about how machine works, how you code them to let them do what you want, and how to collect and process data (which is what I do the most, after all). I already started to learn from the resources that you guys posted; but it s a lot to learn!
I think that I've got the led examples...did plenty of them :D Next step is to get sensors to read values, and do some transmission between the computer and the teensy.
I am already training with a bluetooth module, which seems to work nicely with Teensy. Next step is to add some sensor so I can actually start to read something and crunch numbers :)
 
Let me explain on an example what an Application Note is. I needed to extend the I2C bus to cover +10ft while maintaining a 1MHz bus frequency. I picked the PCA9600 I2C bus buffer from NXP. The Data Sheet explains several configurations, but does not go int too much detail in respect to long I2C bus distances.
However, Application Note AN10658 filled that very application specific void perfectly.

Also, as you are already familiar with xCode you may want to check into embedXcode

I see; I have no idea that it was something like that... you can tell that I am new

I am familiar with Xcode, but I don't really like it much...I use more often Visual Studio, and if I can, I prefer an old PC software called Dev-Cpp. I wrote countless function on that little editor, and I like it a lot. My ideal software is a clean IDE, debugger, easy to set up, with autocomplete and that's all that I consider essential :) anything extra is welcome of course, but I am happy even with simple application.
 
I've only skimmed the responses so far, but from what I read of OP, i don't see why anyone hasn't mentioned that arduino books are totally relevant for teensy.

Yes, teensy is different. But, no, "Arduino Cookbook" is still an *excellent* beginners primer for the light combination of electrical, programming, and practical knowledge needed for these sort of MCU projects.

True, but there are differences in how you address issues thou.

You all know better than me, that to learn things takes months maybe, but it is not enough to read a book to consider yourself "an expert" or even "knowledgeable"; it is the practice that makes a person that study books, an expert.

So from my perspective, I can learn the basics on Arduino books, but then I need to apply it...I am not sure if Arduino code works all the time on Teensy, and if it doesn't...how do I know that it is me doing it wrong, or just an incompatibility betweenn Teensy and Arduino IDE? That's why I thought that the time spent learning something that may apply to Teensy, was better used for something that can actually help me in learning the problems that you experience with Teensy.

The good is that the issues are common to many MC, so if you learn one, you may apply solutions to other brand and types of MC. Not planning to move away from Teensy, but I may use also other MC, so the time is not wasted I believe.
 
To much text. Pick a project, some problem that you need a solution for, perhaps for your lab, think through it and get on your way. When problems arise - accept that they will - try to find applicable information, online or in form of books. Come here and ask questions!

Once you're past the prefabricated book examples, there is nothing that provides you with a better motivation for learning than a real project.

Visual Studio with the Visual Micro plugin is great so one hears, but only works on Windows machines.
For your Mac there is also the Arduino Eclipse IDE/Plugin, for which I've written some detailed installation instructions
 
Once you're past the prefabricated book examples, there is nothing that provides you with a better motivation for learning than a real project.

The above statement is almost never false. It is only false when you simply cannot solve the problem with the available tools.

I currently have the task to build a 7-channel adjustable power supply (0 - 12V, 7 A) and once I had it broken down into small, tasty bites, it was easy. This is the first time I'm using a transistor for something other than just switching. I'm learning a lot right now - not because I decided to read a book, but because it just happens. And the same will happen to you, too, as soon as you tackle something interesting with built-in motivation. Arduino textbook examples are not of that nature!
 
Status
Not open for further replies.
Back
Top