Custom Teensy 3.1 Board - Will not load a program

Status
Not open for further replies.

ambZE

Member
I have a custom board using a teensy 3.1 as the micro. I have read the previous posts (from the Mini54 page) on the forum about custom boards and those issues are not the same as mine. I have also added the schematic.
*Please note that the USB D+ and D- lines in the schematic are reversed, however this has been corrected on the board.

Issue / Symptoms:
When I plug the board into the USB port I do not get a response from the system. When I press the load button the computer gives the sound as if a USB device has been plugged in and the Teensy.exe software recognizes that I have connected a board and shows that the *.cpp file has loaded. The board however does not show up as a serial port and the program does not get loaded on the micro (It is a simple "blink" on pin 13 program and the output does not turn on).

Troubleshooting done so far:
1.) Added a capacitor to the 3.3VDC bus to stabilize the voltage level (this was a suggestion from a previous post).
2.) Tested the Reset pins on the Mini54 and the MK20
a.) When the USB is first plugged in Reset pin is high
b.) When the load button is pressed the Reset pin pulls the pin low
c.) When the load button is released the reset pin goes high again and stays that way
3.) Clock Signal
a.) When the USB power is applied there is no clock signal (which is to be expected)
b.) When I press and release the program button a clock signal appears for a few moments
c.) After the teensy.exe says the program has loaded the clock signal goes away
4.) I have tried the program i am working with to load on a stock teensy and it works just fine.

Any advice would be greatly appreciated.
 

Attachments

  • Schematic.pdf
    181.6 KB · Views: 791
Can you divide your circuit between the teensy-like portion and the other stuff with the opamps? If so, you could narrow the location of the bug down by divide-and-conquere. Does your teensy-like portion of the circuit work without the other stuff attached to it? Does the other stuff work when driven by a stock Teensy?
 
Issue / Symptoms:
When I plug the board into the USB port I do not get a response from the system. When I press the load button the computer gives the sound as if a USB device has been plugged in and the Teensy.exe software recognizes that I have connected a board and shows that the *.cpp file has loaded.

At least this part is perfectly normal. A totally blank MK20 won't do anything, and then when you press the button, the Mini54 takes control and it appears as a HID device with ID 16C0:0478. That's good.

I don't know why the MK20 isn't running your code.

Perhaps a next step might involve some hacking in mk20dx128.c, to see if you can get any signs of life from the MK20 chip. For example, at the beginning of the reset code is a hook that disables the watchdog. Maybe add a "while (1) ;" right after that, so it'll sit in an infinite loop doing nothing. Then try with and without the watchdog. When the watchdog is disabled, the while (1) loop should run forever and the chip will do nothing. When you remove the watchdog disable code, the chip should repeatedly reboot. You can observe the rebooting on the reset line, since the MK20 pulls the reset line low as it reboots. This is easiest to see with an oscilloscope or logic analyzer, since it happens over and over pretty rapidly.

Bringing up brand new hardware can be tricky. There's really not much more I can do to help. This gets pretty far outside the realm of support PJRC can reasonably provide.

But if you do figure out what went wrong, please post a followup with details. You can see the Mini54 page already has links to a couple good followups others have posted. A good followup, together with these messages about how the problem looked before it was understood, can really help others in the future.
 
Paul and Pictographer,

Thank you for your quick replies.

-----------------------------------------------------------------------------------------------------------------------------------------------------

Pictographer, we initially prototyped this with a factory 3.1, everything ran great. We stress tested it and it ran great. Unfortunately this is all on a surface mount PCB and I cannot remove the other portions without destroying it. The portion of the circuit that does not pertain to the teensy is not currently powered during this initial bootup and test.

------------------------------------------------------------------------------------------------------------------------------

Paul, I understand this this is outside of the scope of the standard PJRC service / support, and I appreciate your time to looking at it.

As far as the "HID device with ID 16C0:0478." goes, I am not seeing this device when I connect our board, if you look at the screen cap below this is our device manager with the custom board it does not show the HID device you have described:
custom teensy attached.jpg

When a factory teensy is attached I get the following device tree, which does show the teensy serial port under the COM ports:
factory Teensy attached.jpg

Any idea here?
 
Teensy Loader only responds to HID 16C0:0478. If you're seeing Teensy Loader recognize it, then it must be appearing with that ID.

If Teensy Loader is in auto mode, which is the default when Arduino give it a new file, it'll immediately reboot after programming, so Teensy only appears to your PC with that ID for a brief time during the upload process.

When a factory teensy is attached I get the following device tree, which does show the teensy serial port under the COM ports:

This page explains the native USB and COM port issues. Scroll down to "No Serial Port While Programming".

http://www.pjrc.com/teensy/troubleshoot.html

The key point is Teensy only becomes a COM port because the code you programmed onto the MK20 implements USB serial.
 
Does anyone have a schematic using the Mini54LAN as a TQFP package that works? I would love to be able to reference another schematic to ours to make sure I didn't mess a connection up.
 
We found our error: We did not have 3.3VDC to the VBatt connection. With the 3.3VDC added to this pin we are now running a "blink" program successfully.
 
Good to know what actually happens with VBAT is unconnected.

Can you confirm the Teensy Loader did find your hardware and appeared to program your code, but then it simply didn't run when VBAT was unconnected? Knowing what symptoms really appear can help anyone else who hits this same issue.
 
Hi Paul,

Yes, that is exactly what happened. It actually did program the micro, as soon as I applied 3.3 vdc to vbat the program started running that was already installed.

So it appears that not having that pin connected just does not allow the program to run.

Thanks!

Adam
 
Thanks for the followup. I've added a link to the Mini54 page.

Hopefully this will save anyone else from hitting this pitfall, or at least help them find it more easily if they do.
 
I thought that this might be related to the core startup code and, actually, I found something about this in the K20 Reference manual:

Chapter 40.3.1:
Any attempt to access an RTC register, except the access control registers, when VBAT is powered down, when the RTC is electrically isolated, or when VBAT POR is asserted, will result in a bus error.

So, if VBAT is unconnected, you should be able to make it work by commenting out the RTC_xxxx related code in the core library (mk20dx128.c).
 
Excellent work.

We will be attempting to roll our own Teensy based boards in the future and posts like this will prove valuable I'm sure.

Thanks.
 
I thought that this might be related to the core startup code and, actually, I found something about this in the K20 Reference manual:



So, if VBAT is unconnected, you should be able to make it work by commenting out the RTC_xxxx related code in the core library (mk20dx128.c).

Awesome find. Thank you.
 
I have made my own experiances with a custom Teensy board. I messed up the first revision. This forum has been very helpful and I thought to give something back. I have written a rather lengthy blog post that summerizes everything I have found in these forums, part numbers I have been using successfully, PCB layouts, etc. If you are interested in building your own Teensy board I think my blog post will help you with that.

http://www.appfruits.com/2015/03/building-your-own-custom-teensy/

Have fun and good Luck,
Phillip
 
I unfortunately did not find this thread before I too built boards without a VBAT connection.

My results are essentially identical: lots of USB beeps and no running code until I comment out lines 634-->640 and lines 875-->905 in mk20dx128.c @ Arduino\hardware\teensy\avr\cores\teensy3
 
The RTC hardware is exactly the same on Teensy 3.6, so you'd make exactly the same edit to mk20dx128.c. Just delete all the RTC initialization stuff.

Or you could fix your board to connect 3.3V power to VBAT.
 
Status
Not open for further replies.
Back
Top