Difference between revisions of "NU32: Using the TB6612 H-Bridge"

From Mech
Jump to navigationJump to search
(New page: *** UNDER CONSTRUCTION NDM 2/17/2012*** Using the dsPIC33FJ for quad decode == Overview == Why this chip == Details == The board == Library Functions == [[Media:NU32SerialExample.zip ...)
 
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''THIS PAGE REFERS TO A PRE-RELEASE VERSION OF THE NU32 PIC32 DEVELOPMENT BOARD. FOR INFORMATION, SAMPLE CODE, AND VIDEOS RELATED TO THE PRODUCTION VERSION (2016 AND LATER), AND TO THE CORRESPONDING BOOK "EMBEDDED COMPUTING AND MECHATRONICS WITH THE PIC32 MICROCONTROLLER," VISIT [[NU32|THE NU32 PAGE]].'''
*** UNDER CONSTRUCTION NDM 2/17/2012***


Using the dsPIC33FJ for quad decode


Using the TB6612 H-bridge.
== Overview ==


[[Image:NU32_TB6612.jpg|thumb|200px|The TB6612 breakout board|center]]
Why this chip


== Details ==
== Overview ==
The board


[[Media:TB6612.pdf|Datasheet]]
== Library Functions ==
[[Media:NU32SerialExample.zip | This code]] How to get the count


The TB6612 is a MOSFET based motor driver.
The functions are:
*void NU32_Initialize(void) - enables UART1 and UART4 at 115200 baud. UART4 starts with the interrupt at priority level 3, UART1 starts with no interrupt enabled
*void NU32_EnableUART1Interrupt(void) - enables the UART1 interrupt
*void NU32_WriteUART1(const char *) - call with the character array you wish to send, make the array with sprintf()
*void NU32_ReadUART1(char *, int) - call with the array you want to read into, and the maximum size of the array. The code will wait at this function and buffer all characters received until you send a '\r' or '\n' (by pressing [enter] on your keyboard)


== Wiring ==
NU32Example.c in the .zip file above demonstrates how to use the functions.
[[Image:TB6612andMAX9918_wireup.png|thumb|600px|center]]


== Sample Code ==
== Details ==
Use the following table to determine the motor output:

To initialize the serial communication, call NU32_Initialize(), :

<pre>
NU32_Initialize();
</pre>


[[Image:TB6612.png|thumb|600px|The TB6612 logic table|center]]
To write a string to the computer, use NU32_WriteUART1(charArray). The special characters '\r' and '\n' are carriage return and newline. Using them together puts the cursor on the next line.


<pre>
NU32_WriteUART1("\r\nHello World!\r\n");
</pre>


To write a string with the value of a variable in it, use sprintf(charArray,"%d") and NU32_WriteUART1(charArray).


== More Information ==
== More Information ==

Latest revision as of 05:37, 16 January 2016

THIS PAGE REFERS TO A PRE-RELEASE VERSION OF THE NU32 PIC32 DEVELOPMENT BOARD. FOR INFORMATION, SAMPLE CODE, AND VIDEOS RELATED TO THE PRODUCTION VERSION (2016 AND LATER), AND TO THE CORRESPONDING BOOK "EMBEDDED COMPUTING AND MECHATRONICS WITH THE PIC32 MICROCONTROLLER," VISIT THE NU32 PAGE.


Using the TB6612 H-bridge.

The TB6612 breakout board

Overview

Datasheet

The TB6612 is a MOSFET based motor driver.

Wiring

TB6612andMAX9918 wireup.png

Details

Use the following table to determine the motor output:

The TB6612 logic table


More Information

NA