Search This Blog

Wednesday, November 25, 2015

CC2531 Zigbee USB Dongle

CC2531 USB Evaluation Module Kit ကိုသုံးပြီး wireless communication လုပ်ကြည့်တဲ့ အကြောင်းလေးပါ။ သူ့ရဲ့ website ကိုသွားပြီး CC USB Firmware Library and Examples ဆိုတဲ့ zip ဖိုင်ကို download လုပ်လိုက်ပါတယ်။ ဖိုင်ကိုဖြည်ပြီးတဲ့ အခါ Doc folder ထဲက CC USB Software Examples User’s Guide ထဲမှာ နမူနာပြထားတဲ့ USB RF Modem Example ကို စမ်းကြည့်ခဲ့ပါတယ်။

CC2531 Zigbee Wireless USB Dongle

နောက်တခါ SmartRF05EB board တခုက CC2530DK_EM module လေးကို ဖြုတ်လိုက်ပြီး အောက်မှာပြထားတဲ့ အတိုင်း connector P3 - ExtSoC Debug မှာ CC2531 USB Dongle ကို ဆက်လိုက်ပါတယ်။ CC2531 dongle အတွက်လည်း power supply အနေနဲ့ USB ကြိုးဆက်ဖို့လိုပါတယ်။

Connecting CC2531 to RF05 Board for debugging.

ပြီးတဲ့အခါ ခုနက swrc088c.zip ဆိုတဲ့ zip file ကို ဖြည်လိုက်တဲ့ အခါ ရလာတဲ့ folder တွေထဲက ide ဆိုတဲ့ folder ထဲက usb_app_ex.eww ဆိုတဲ့ workspace ကို IAR EW နဲ့ ဖွင့်လိုက်ပါတယ်။ IAR ဗားရှင်းမတူခဲ့ရင် တက်လာတဲ့ dialog box တွေမှာ ok နဲ့ yes တွေကိုနှိပ်လို့ရပါတယ်။ ပြီးရင် ဘယ်ဖက်အပေါ်မှာ rf_modem - rfusb_cc2531 ဆိုတဲ့ project ကို ရွေးလိုက်ပါတယ်။ Project ကို clean လုပ်ပြီး၊ rebuild all လုပ်လိုက်တဲ့ အခါ warning တချို့ တက်လာပေမယ့် ပြဿနာ မရှိပါဘူး။ Download and Debug လုပ်ရင်တော့ linker error တက်ပါတယ်။ အဲဒါကို ဖြေရှင်းဖို့ Project menu ကိုသွား Options ကိုနှိပ်ပြီး Linker ထဲက Config ရဲ့ Linker configuration file ဆိုတဲ့နေရာမှာ C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\8051\config\devices\Texas Instruments\lnk51ew_cc2531F256.xcl ကို ရွေးပေးဖို့ လိုပါတယ်။ အဲဒါဆို dongle ထဲကို firmware download လုပ်ပြီး debug လုပ်လို့ရပါပြီ။

RF Modem settings.

CC2531 USB dongle ကို debug လုပ်ရာကနေဖြုတ်ပြီး တခြား ကွန်ပျူတာ ဖြစ်ဖြစ် USB မှာ တပ်လိုက်ရင် ကွန်ပျူတာက driver ကို install လုပ်ပါတယ်။ zip file ကို ဖြည်လိုက်တဲ့ အခါ ရလာတဲ့ folder တွေထဲက driver ဆိုတဲ့ folder ထဲက usb_cdc_driver_cc2531.inf ကို ရွေးပြီး သုံးနိုင်ပါတယ်။ အဲဒီအခါ ကွန်ပျူတာမှာ comm port တခု ရလာပါတယ်။ အဲဒီ port ကို 38400 baud, 8 bits, 1 stop bit, no parity, hardware handshaking သုံးပြီးဖွင့်ပါတယ်။

ပြီးရင် ကျန်တဲ့ အရင် CC2530 EM ပဲတပ်ထားလက်စ တခြား RF05 Board ကို IAR IDE စက်မှာပြောင်းပြီး ဆက်လိုက်ပါမယ်။ IAR IDE မှာ ဘယ်ဖက်အပေါ်က drop down list မှာ rf_modem - srf05_cc2530 ဆိုတဲ့ project ကိုရွေးပါတယ်။ အရင်ဟာလိုပဲ rebuild all လုပ်လို့ရပေမယ့် linker error ရှိပါတယ်။ Linker configuration file ဆိုတဲ့နေရာမှာ C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\8051\config\devices\Texas Instruments\lnk51ew_cc2530F256.xcl ကို ရွေးပေးဖို့ လိုပါတယ်။ ပရိုဂရမ် ထည့်ပြီးတဲ့ အခါ LCD screen မှာ Device Role: Device 1 လို့ပေါ်အောင် လိုအပ်ရင် joystick နဲ့ ရွေးပေးနိုင်ပါတယ်။ ပြီးရင် Button 1 ကိုနှိုပ်လိုက်တဲ့ အခါ MRFI RF modem Device 1 ready လို့ ပြပါလိမ့်မယ်။ အဲဒီနောက် သူ့ရဲ့ RS232 ကို ကွန်ပျူတာနဲ့ ဆက်ပြီး ခုနက settings တွေအတိုင်းသုံးပြီးဖွင့်ပြီး တဲ့အခါ ဒေတာတွေကို အပြန်အလှန် wireless နဲ့ပို့လို့ရတာကို တွေ့ရပါတယ်။

RF Modem board.

No comments:

Post a Comment