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.

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


Front page   New List of pages Search Recent changes   RSS of recent changes