STM32F103を使ってみる

WIZ550ioモジュール



今までW5500チップのモジュールを使ってきましたが、WIZ550ioモジュールを入手しました。
モジュールの詳細はこちらで紹介して いますが、ボード上に実装されているPICマイコンにMACアドレスが書き込まれています。
Arduino_STM32 Coreに含まれているEthernet_STMライブラリは、このモジュールをサポートしています。
ボード上に実装されているPICマイコンのMACアドレスを利用するためには、最初に以下のファイルを一部変更します

{Arduino-IDEインストールフォルダー}\hardware\Arduino_STM32-master\STM32F1 \libraries\Ethernet_STM\src\utility\w5100.h

赤文字のdefineを有効にします。
/*
 * Copyright (c) 2013 by WIZnet <support@wiznet.co.kr>
 *
 * This file is free software; you can redistribute it and/or modify
 * it under the terms of either the GNU General Public License version 2
 * or the GNU Lesser General Public License version 2.1, both as
 * published by the Free Software Foundation.
 */

#ifndef    W5100_H_INCLUDED
#define    W5100_H_INCLUDED

#include <SPI.h>

typedef uint8_t SOCKET;

//#define W5100_ETHERNET_SHIELD // Arduino Ethenret Shield and Compatibles ...
//#define W5200_ETHERNET_SHIELD // WIZ820io, W5200 Ethernet Shield
#define W5500_ETHERNET_SHIELD   // WIZ550io, ioShield series of WIZnet

#if defined(W5500_ETHERNET_SHIELD)
#define WIZ550io_WITH_MACADDRESS // Use assigned MAC address of WIZ550io
#include "utility/w5500.h"
#endif


これで、スケッチ内でMACアドレスを指定しなくても、PICマイコンのMACアドレスが自動的に使われます。
以下がMQTTクライアントを動かしたときの表示です。
赤枠の部分がPICマイコンから取り出したMACアドレスです。
モジュールに貼られているシールに記載のMACアドレスと同じものが表示されます。


次回はEEPROM emulation機能を紹介します。

続く...