ANT

ANT/BC-ANT-SERIAL with Data Display

This is an example of electrics work, which employs BC-ANT-SERIAL and an LCD display unit. This display units shows the status of ANT communication, which the BC-ANT-SERIAL is currently engaging.

BC-ANT-SERIAL can be connected to a microcontroller with only five pins. One pin is used for power supply between 1.9V and 3.3V, and another pin works with ground. The other three pins are assigned to TXD, RXD, and RTS at single end. (Using the pads, rest, sleep, suspend functions of ANT chip can be managed.) The five pins can accept 2.54mm pitch (0.1inch) pin-headers, which are commonly used.

This example uses PIC24F64GA002 (28pin, 300mil width, and DIP) of Microchip Technology Inc.

  • Example of Implementation
    DSCF8198.JPG
  • Parts List
    No.qty.ReferenceProduct NameSpecificationsMemo
    12C1, C2Laminated Ceramic Capacitor0.1uFNon-specific, any qualified products
    21C3Tantalum Capacitor10uFElectrolytic capacitor, attention to the polarity
    31C4Laminated Ceramic Capacitor10uFThis must be a laminated ceramic capacitor, electrolytic capacitor is not acceptable
    44D1, D2, D3, D5LEDEither chip type or /w lead φ3~5mm
    51J2Female Pin Header (Pin Header Socket)1 x 5 pin2.54mm pitch, it is adjusted to BC-ANT-SERIAL
    61J3Pin Header1 x 6 pin2.54mm pitch, used for connecting to PICKit and other connectors for programming
    71R1Resistor 1/16 ~ 1/4W10kΩ
    84R2, R3, R4, R5Resistor 1/16 ~ 1/4W1.5kΩApproximately 330 ~ 3.9kΩ, the value is highly deponent on which types of LEDs are used here. For LEDs with lead φ3~5mm, select 330 ~510Ω of resistors. To use chip LEDs, resistors are not specified.
    91R6Resistor 1/16 ~ 1/4W10kΩSemi-fixed resistor
    104S1, S2, S3, S4Push SwitchMomentary TypeAs it is pressed, it is turned ON.
    111U1CPUPIC24FJ64GA002You may buy any parts-shops.
    121U4LEDSC1602BS-B(-XA-GB-K)You may replace this with other models, but pins of some LEDs are not compatible with this model's. Please be careful.
    131U5DC-DC ConvertorDC-DC boost converter, 5V 0.2Aoutput, StepUp・DIP-Ver.2It is used for boosting 3.3V to 5V. If your LED can accept 3.3V, this will not be needed.
    141BC-ANT-SERIAL
    151Pin Header1 x 5 pinThis 2.54mm pitch pin header is soldered on BC-ANT-SERIAL and connected to J2

LEDs, resistors, capacitors, a switch, pin headers, and a CPU can be purchased at any electrics parts shops, mail orders, and/or the internet.

Please carefully assemble the data display. In this section, checking (critical) points are stated here.

C3 is added if the power line is unstable. A 1~10uF of tantalum capacitor is suitable for this case. There is polarity, excepting some. The + terminal of the capacitor is connected to Vdd, and the – terminal is attached to GND.

LEDs are turned on if 0 is sent, and they are turned off if there is 1. The values of resistors (R2 ~ R5) are adjusted to types of the LEDs.
To use the size 1608 of chip LED, the LED is emitted with few electric current (less than 500μA), so a 1.5kΩ resistor is selected on the schematic. However, to use the LED with a 5mm diameter lead, 2~3 mA of electric current is required for recognizably emitting the LED. The value of resistor is needed to me small. A chip LED accepts 2~3mA of electric current, so the value of resistor should be 330 ~ 510Ω. (If the quiescent current is increased, the LED emits brighter. In this example, the resistor that works with the chip LED is set around 2kΩ.)

The push switch connects to GND while it makes the pull-up resistor, which is included in CPU, is effective. As the switch is disconnected, 1 is read. As it is connected, 0 is read.
If this pull-up resistor remains ineffective and the power supply is turned on, its input terminal becomes unstable. 1 is often read, but CPU may not work currently. In the worst case, it causes thermal issue, and the CPU gets really hot. Eventually, the CPU breaks because of the high temperature of the CPU. To avoid the worst case happening, please add a pull-up resistor to the power supply.

The development environment for this project is MPLAB IDE.
Create a “New Project” and select PIC24FJ64GA002 as CPU. PICKit2 or PICKit 3 can be used as programmer. The source code debugger can be used here, too. To set up power supply for this board, 3.3V power supply is attached to J3 pin, the + terminal and - terminal are connected to the 2nd pin and 3rd pins, respectively.

Program Example

A set of program files is shown below. Each file is added to the created project. To do “Compile/Program,” compile it and download to the PIC.

Explanation

To execute this program, the title screen appears. Then, to press SW4, start executing the program.
At the first line of the LCD screen, a received command and a part of payload in hexadecimal. The second line shows the number of received data.
To press SW1, open ANT channel in the transmitting mode, broadcast the data, and turn on LED1.
To press SW2, open ANT channel in the receiving mode, receive the data, and turn on LED2. If it cannot receive ANT signals and faces the timeout, it closes the channel and turns off the LED2.
To press SW3, send the order of software resetting to the ANT module, turn off LED1 and LED2. It stays in the waiting mode.

Most processes are written in the main() function.

Revision History

  • 2013/02/06 This article is initially uploaded

Attach file: filemaker-2012-0005a.pdf 516 download [Information] fileDSCF8198.JPG 561 download [Information] fileant.c 517 download [Information] fileC_LCD.c 516 download [Information] filedelay.c 529 download [Information] filemain.c 547 download [Information] fileuart.c 475 download [Information] fileant.h 549 download [Information] fileC_LCD.h 521 download [Information] filedelay.h 517 download [Information] fileuart.h 519 download [Information]

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   RSS of recent changes
Last-modified: 2013-02-06 (Wed) 07:47:03 (1745d)