The FRDM-TFC is a convenient "shield" that can drive up to two DC motors (5A per channel), two servos and I/O for the Freescale cup line scan camera and Hall effect sensors. This board mates with the KL25Z Freedom board for primary usage with a Freescale Cup car.
Varies by region. But yes, starting in 2014 we will be offering a freedom based version. What you see above is the work we are doing today to get it ready.
**The rules will likely stay the same that you can use any Freescale 32-bit MCU.
Still reading the specs but I assume the KL25Z is getting power from the power up of the TFC shield? Saw the ground warnings about not powering up both (TFC with battery while KL25Z from USB) so likely we have to program first (no batt)-- then unplug USB to test with battery (or other 7.2V, 0.1A source). There is no direct way to test the car 'online' so to speak.
Comment in the assembly manual PUB doc near the end: "Never power the microcontroller from different power sources! Switch off the MCU board before you connect your it to your PC." Also here: https://community.freescale.com/docs/DOC-1020 where it mentions:
NOTE: Never power the microprocessor board and interface boards from different power supplies! In such case the grounds on both boards are
not connected and you can damage the board. The grey flat ribbon cable that interconnects the boards is for signals only, there is no common
GND connection!"
This could be specific to the Qorriva implementation-- just wanted to be sure before frying anything.
It was an issue with that setup. More broadly though, it is still a valid preventative caution. Don't assume! Read the schematics and understand what the underlying circuitry is doing.
This is not an issue KL25Z based TFC board. The return for the battery and the return for the USB are tied together so the reference potential is held to the same value.
That being said.... Here is the only issue you may have. NEVER measure the voltage across the motors during operation with a scope ground connected to either side. This could cause a path issue. With an H-Bridge, The outputs are references to 1/2 VCC. This could cause an issue unless you scope is floating or running on battery. You can look at each side of the motor (H-BRIDGE) with respect the GND on the PCB and be OK or take a different measurement.
Thanks—Was not looking to measure the actual motor voltage but the PWM inputs to the Hbridge very soon to confirm the issue that David found (where openSDA appears to cause contention)—as I saw some funny stuff when operating the demo code.
How can I find out how to use the inputs of the H-Bridge control? I get from the schematic that there are 8 inputs (A-IN1, A-IN2, A-IFB, ENABLE, FAULT, B-IN1, B-IN2, B-IFB) and the schematic shows their corresponding pins, but I don't know what signals to give them. The example code doesn't seem to be using all of them, and I'm planning to write code using Processor Expert components. Can I find the specs somewhere?
1.) Have you looked at the Datasheet for the part? It has a good picture of the internals! Even processor expert won't tell you how the chip works. It is important to study datasheet *before* you write any code
2.) Study the source code for the example code to see how it works. Basically, you need to drive complementary signals into each bridge.
I think I have the wrong datasheet(http://cache.freescale.com/files/analog/doc/data_sheet/MC33931.pdf) because it shows me less pins (IN1, IN2, D1, D2) than the ones from the schematic, and I'm not sure how they correspond to those from the TFC shield and therefore, to those from the KL25Z board. Can you tell me if it's the right one and if it is, how to deal with the pin problem?
I've studied the code and your videos on how to control the motors, and the demo videos. I've tested your code and it works. I have some troubles in writing code like yours, but with PE components. Maybe with the answer from question 1), I'll understand what I'm missing.
Anyway, it still shows me less pins (IN1, IN2, D1, D2, EN) and I don't know how they corespond to the ones from the schematic (A-IN1, A-IN2, A-IFB, ENABLE, FAULT, B-IN1, B-IN2, B-IFB) or the ones in your code. Your insight would be most helpful.
Did you get schematics? If you did, you will see the page that has the 2 H-Bridges and the signal mapping. There are 2 sets of signals for each H-Bridge
I managed to get the code working. Turns out I only need to set ENABLE to High and send complementary PWM signals to A-IN1, A-IN2 to controll the speed and direction of motor A, and send complementary PWM signals to B-IN1, B-IN2 to controll the speed and direction of motor B. I would have been stuck without your help.
Hi, see https://community.freescale.com/docs/DOC-95170 for the implementation of the speed sensor. To my knowledge there is no sample code readily available from Freescale but I would post the question in the open forum or your respective region to see if a team member from another group can share one with you.
I am quite backed up with work right now. Some source code would be helpful.
My guess is that the environment is getting trashed by Processor Expert. My best advice is to inspect the device registers with the debugger and see what isn't configured right. Also, since you have working drivers, just skip PE and get to writing your application.
We have been provided 7.2V 2000mAh Ni-Cd battery with the freescale kit and 12V charger.So, what can be the maximum voltage of the Ni-Cd battery when fully charged? once when i charged, it reaches upto 8.5V, so I fear of damaging the battery.
So, Should I charge it with given charger and Charge battery upto 9V??
my team is starting at the innovation cup and we want to use this TFC-Shield combined with the FRDM K64F board. Is there any example like this, how to use the TFC-Shield in a K64F project?
TFC-Shield and K64F is a logical combination, but unfortunately not an easy one. As the boards don't have the compatible pinouts, you'll need to rewire the connections
and can't use the boards immediately. Here you can find the comparison table (also Arduino Uno included, as the producer declared the boards compatible with Arduino shields):
I have wired it up and it isn't too bad. Some notes:
1.) The selection of I/O on the FRDM board was based upon TPM (Timer Pulse Width Modulators) availability to optimize the usage of the hardware. It was not mapped to Arduino as the psuedo standard pinout was not optimal for using the the FRDM board. Arduino compatibility really only means power and some I/O line up and that it meets a mechanical footprint.
2.) TPM0 (labeled as FTM0 in the spreadsheet) is the Timebase for the PWM to the DC motors. You need complimentary drive so you need 2 channels of TPM on the same time base (@5-10Khz switching)
3.) TPM1 channels 0 and 1 are for the servo time base. It is *much* slower period than the motor drive so it needs it's own time base.
4.) The speed sensors are on there own time base (TPM2).
5.) The K64 CPU has FTM units, not TPM like the KL25Z. FTM peripherals are more complex are you will need to port functionality! This means you will need to read the reference manual and write some code.
So, before you start, make sure you absolutely understand what signals are needed to drive the motors (@10KHz complimentary PWM) and servo (0.5mS to 2mSec pulse @ 20mS period). You need map these signals onto the flex timer units on the K64. Some of the signals line up and others do not. I only needed a couple of air wires to make the connections. The bigger job is updating the code to the FTM and not TPM.
It is a good academic exercise but you must first fundamentally understand the IO on the FRDM-TFC. Once you understand the IO and peripherals you should be able to wire it up to *any* microcontroller.