This is only a preview of the June 2024 issue of Silicon Chip. You can view 57 of the 112 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Arduino Clap Light":
Items relevant to "ESR Test Tweezers":
Items relevant to "MicroMag3 Magnetic Sensor":
Items relevant to "USB-C Serial Adaptor":
Items relevant to "DC Supply Protectors":
Items relevant to "WiFi DDS Function Generator, Pt2":
Items relevant to "Arduino bin reminder":
Purchase a printed copy of this issue for $12.50. |
Programming a Micromite over Bluetooth
In the September 2021 issue, Tom
Hartley described how to connect an
HC-05 device to a Micromite using
an Android phone (siliconchip.au/
Article/15031). Tom's article made me
realise that if I could get an HC-05 to
work under TeraTerm, I could change
my programs wirelessly.
Many computers these days have
built-in WiFi (including many desktops and virtually all portable computers). If they do, they usually have
Bluetooth support as well. If not, you
can get a USB Bluetooth adaptor for
just a few dollars. Once you have a
Windows computer with Bluetooth,
you just need an HC-05 adaptor to program Micromites remotely!
Under Windows 10, when an HC-05
Bluetooth device is detected, it creates
two virtual COM ports. Windows 10
has drivers for the HC-05, so no drivers
need to be installed. The great thing
is that TeraTerm does not know the
difference between virtual and real
COM ports, so it works as if wires were
connected.
In Tom's article from September
2021, he describes how to attach the
HC-05 to a USB-TTL serial converter
to set it up. He mentioned that some
HC-05 devices come without an enable
button, but these may be set up to a
baud rate of 38,400, so they may work
without being set up. The devices I
received had the enable button; they
were set to 38,400 baud, but they still
did not work without the setup procedure.
Try to get the HC-05 that looks the
same as the picture in Tom's article,
with the tiny button on one side of
the board close to the EN pin. Another
thing to check is that there are six pins
on the module.
Setting up the module
Set up the module using Tom's
98
Silicon Chip
excellent instructions. He suggested
powering the module from a 4.5V
battery pack via a switch, but I used
3.3V from a CP2102 USB-TTL serial
converter (Jaycar XC4464) via jumper
wires. Plugging and unplugging the
3.3V jumper wire acts as a switch.
We are not using USB to connect
to the Micromite; the HC-05 has a
serial output and connects directly
to the serial input of the Micromite.
If the Micromite has a USB connection, it must be disabled. For example, a Micromite LCD Backpack V3
can be configured for straight serial
by removing the PIC16F1455 chip
and connecting via the 5V/TX/RX/
GND header.
Once you have followed Tom’s
instructions to set up the HC-05,
unplug it from the CP210x USB-toTTL serial converter and remove the
CP210x from the computer USB port.
Connect the HC-05 Tx pin to the
Micromite’s Rx pin and vice versa.
Connect the two GNDs together and
the HC-05 Vcc to the Micromite’s 5V
pin. Don’t connect the STATE or EN
pins on the HC-05 module.
The Micromite may be powered
from any 5V source. The Micromite
can now be several meters away from
the Windows 10 computer, with no
wires connected between them.
Once the HC-05 is powered up (no
need to press the button this time), go
to the computer’s Bluetooth settings to
pair with the HC-05. You should see
a Bluetooth symbol next to the computer’s system clock, at the right end
of the taskbar. If you can't see it, try
pressing the ^ symbol. Click on the
Bluetooth symbol and choose “Add a
Bluetooth Device”.
On the screen that pops up, click
on the plus button next to “Add Bluetooth or other device” near the top
of the window. You will get a menu
Australia's electronics magazine
titled “Add a device”. Choose the top
option: “Bluetooth (Mice, keyboards,
pens, or audio and other kinds of Bluetooth devices)”.
You might see “HC-05” or “unknown
device” appear, then the name should
change to the name you gave it during
set-up.
Click on that and type 1234 in the
password box that pops up. When the
‘paired’ notification pops up, click
Done. Open Device Manager again
and look under ports. You should
see two new serial ports; mine were
COM3 and COM6. I used the first
one, COM3.
In TeraTerm, use the File → New
Connection menu option, set the Serial
Port to COM3 (or whatever the first
port in Device Manager was), then
click OK. Set the terminal settings to
how they should be to talk to a Micromite (in the Setup menu, click Terminal). That is, Local Echo off, Receive
set to CR and Transmit set to CR.
Now you are all set to program your
Micromite. To test the connection,
press Enter, and you should see the ">"
prompt. You can type EDIT to access
the full-screen editor or LIST to view
the program.
Note that if you have more than
one HC-05, you have to remove one
HC-05 from the Bluetooth setup window before you can communicate
with the next one; at least, that was
my experience.
Now we have an HC-05 programmed to talk to the Micromite
at 38,400 baud with the correct parity settings. It can be left attached to
the Micromite board. You could put
it in a project anywhere nearby and
blissfully program away with nothing
cluttering up the place except your
computer!
Grant Muir,
Sockburn, New Zealand. ($75)
siliconchip.com.au
|