0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

platformioでezusb

Last updated at Posted at 2019-06-07

PlatformIOに8051なターゲットがあり日本ではあまり馴染みがないマイコンチップなのですが、toolchainがsdccのようなので、EZ-USBのビルドを試してみました。

とりあえず.platformio/boards/にezusb.jsonを作ります。

{
  "platform": "intel_mcs51",
  "build": {
    "core": "ezusb",
    "f_cpu": "24000000L",
    "size_heap": 256,
    "size_iram": 256,
    "size_xram": 256,
    "size_code": 4096,
    "mcu": "AN2121SC",
    "cpu": "mcs51",
    "variant": "ezusb"
  },
  "frameworks": [],
  "upload": {
    "maximum_ram_size": 512,
    "maximum_size": 4096
  },
  "name": "EZ USB",
  "url": "https://www.cypress.com",
  "vendor": "Cypress"
}
% pio init --board=ezusb

これでraktajinoさんのページにあったLチカのコードをコンパイルしてみます。こちらのコードはsdcc2の頃のコードでsdcc3ではatを__atのように変更が必要です。他には修正は必要ありませんでした。

pio runでビルドして、Ezloadでダウンロードしてみます。

% Ezload -v 0x0547 -p 0x2131 -f .pioenvs/ezusb/firmware.hex 

Lチカできました。

EZ-USBを使ったモジュールでI2CのEEPROMからプログラムをロードしていても、EEPROMを外すとUSBで生のEZ-USBが見えるようになります。

追記

TIのTUSB3410は8052で同じようにプログラムをUSBでダウンロードして使うタイプのチップでした。このチップはCDCを主なターゲットにしたデバイスのようです。ダウンロードするプログラムのコードとダウンロード用のコマンドのソースはここにありました。

platformioがサポートしているSTCのマイコンはaitendoで取り扱ってました。

とはいえ8051はいろいろなジャンクに張り付いているので、おそらく買うことはないでしょう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?