boot EM250 Bootloader.

Dependencies:   mbed

EA LPC4088 QSBでXBeeのEM250 Bootloaderを起動するテストプログラムです。
/media/uploads/va009039/lpc4088-xbee-bootloader.png
参考:
http://ftp1.digi.com/support/documentation/90000976_S.pdf

Committer:
va009039
Date:
Sun May 25 02:18:29 2014 +0000
Revision:
0:ec1046eaf27e
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:ec1046eaf27e 1 #include "mbed.h"
va009039 0:ec1046eaf27e 2
va009039 0:ec1046eaf27e 3 #define XBEE_UART P4_22,P4_23
va009039 0:ec1046eaf27e 4 DigitalOut nDTR(P4_19);
va009039 0:ec1046eaf27e 5 DigitalOut nRTS(P4_21);
va009039 0:ec1046eaf27e 6 DigitalOut nRESET(P4_17);
va009039 0:ec1046eaf27e 7 DigitalOut DIN(P4_22);
va009039 0:ec1046eaf27e 8 RawSerial pc(MBED_UARTUSB);
va009039 0:ec1046eaf27e 9 DigitalOut led_tx(LED1),led_rx(LED2);
va009039 0:ec1046eaf27e 10
va009039 0:ec1046eaf27e 11 int main() {
va009039 0:ec1046eaf27e 12 pc.baud(115200);
va009039 0:ec1046eaf27e 13
va009039 0:ec1046eaf27e 14 nDTR = 0;
va009039 0:ec1046eaf27e 15 nRTS = 1;
va009039 0:ec1046eaf27e 16 DIN = 0;
va009039 0:ec1046eaf27e 17 nRESET = 1;
va009039 0:ec1046eaf27e 18 wait_ms(1);
va009039 0:ec1046eaf27e 19 nRESET = 0;
va009039 0:ec1046eaf27e 20 wait_ms(1);
va009039 0:ec1046eaf27e 21 nRESET = 1;
va009039 0:ec1046eaf27e 22 wait_ms(10);
va009039 0:ec1046eaf27e 23
va009039 0:ec1046eaf27e 24 RawSerial xbee(XBEE_UART);
va009039 0:ec1046eaf27e 25 xbee.baud(115200);
va009039 0:ec1046eaf27e 26
va009039 0:ec1046eaf27e 27 xbee.putc(0x0d);
va009039 0:ec1046eaf27e 28
va009039 0:ec1046eaf27e 29 while(1) {
va009039 0:ec1046eaf27e 30 if (xbee.readable()) {
va009039 0:ec1046eaf27e 31 pc.putc(xbee.getc());
va009039 0:ec1046eaf27e 32 led_tx = !led_tx;
va009039 0:ec1046eaf27e 33 }
va009039 0:ec1046eaf27e 34 if (pc.readable()) {
va009039 0:ec1046eaf27e 35 xbee.putc(pc.getc());
va009039 0:ec1046eaf27e 36 led_rx = !led_rx;
va009039 0:ec1046eaf27e 37 }
va009039 0:ec1046eaf27e 38 }
va009039 0:ec1046eaf27e 39 }