The official mbed C/C SDK provides the software platform and libraries to build your applications.
Fork of mbed by
(01.May.2014) started sales! http://www.switch-science.com/catalog/1717/
(13.March.2014) updated to 0.5.0
This is a pin conversion PCB from mbed 1768/11U24 to arduino UNO.
- So if you have both mbed and arduino shields, I guess you would be happy with such a conversion board :)
Photos
- Board photo vvv
- Schematic photo vvv
- Functionality photo vvv
Latest eagle files
PCB >> /media/uploads/k4zuki/mbedshield050.brd
SCH >> /media/uploads/k4zuki/mbedshield050.sch
BIG changes from previous version
- Ethernet RJ45 connector is removed.
- http://mbed.org/components/Seeed-Ethernet-Shield-V20/ is the biggest hint to use Ethernet!
MostALL of components can be bought at Akizuki http://akizukidenshi.com/- But sorry, they do not send parts to abroad
- Pinout is changed!
arduino | 0.4.0 | 0.5.0 |
---|---|---|
D4 | p12 | p21 |
D5 | p11 | p22 |
MOSI_ | none | p11 |
MISO_ | none | p12 |
SCK_ | none | p13 |
This design has bug(s)
- I2C functional pin differs between 1768 and 11U24.
Fixed bugs here
- MiniUSB cable cannot be connected on mbed if you solder high-height electrolytic capacitor on C3.
- http://akizukidenshi.com/catalog/g/gP-05002/ is the solution to make this 100% AKIZUKI parts!
- the 6-pin ISP port is not inprimented in version 0.4.0
it will be fixed in later version 0.4.1/0.4.2/0.5.0This has beenfixed
I am doing some porting to use existing arduino shields but it may faster if you do it by yourself...
you can use arduino PinName "A0-A5,D0-D13" plus backside SPI port for easier porting.
To do this you have to edit PinName enum in
- "mbed/TARGET_LPC1768/PinNames.h" or
- "mbed/TARGET_LPC11U24/PinNames.h" as per your target mbed.
here is the actual list: This list includes define switch to switch pin assignment
part_of_PinNames.h
USBTX = P0_2, USBRX = P0_3, //from here mbeDshield mod D0=p27, D1=p28, D2=p14, D3=p13, #ifdef MBEDSHIELD_050 MOSI_=p11, MISO_=p12, SCK_=p13, D4=p21, D5=p22, #else D4=p12, D5=p11, #endif D6=p23, D7=p24, D8=p25, D9=p26, D10=p8, D11=p5, D12=p6, D13=p7, A0=p15, A1=p16, A2=p17, A3=p18, A4=p19, A5=p20, SDA=p9, SCL=p10, //mbeDshield mod ends here // Not connected NC = (int)0xFFFFFFFF
Ethernet.h@43:e2ed12d17f06, 2012-10-26 (annotated)
- Committer:
- emilmont
- Date:
- Fri Oct 26 17:40:46 2012 +0100
- Revision:
- 43:e2ed12d17f06
- Parent:
- 27:7110ebee3484
- Child:
- 44:24d45a770a51
Update documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rolf.meyer@arm.com | 11:1c1ebd0324fa | 1 | /* mbed Microcontroller Library - Ethernet |
emilmont | 27:7110ebee3484 | 2 | * Copyright (c) 2009-2011 ARM Limited. All rights reserved. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 3 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 4 | |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 5 | #ifndef MBED_ETHERNET_H |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 6 | #define MBED_ETHERNET_H |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 7 | |
emilmont | 27:7110ebee3484 | 8 | #include "device.h" |
emilmont | 27:7110ebee3484 | 9 | |
emilmont | 27:7110ebee3484 | 10 | #if DEVICE_ETHERNET |
emilmont | 27:7110ebee3484 | 11 | |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 12 | #include "Base.h" |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 13 | |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 14 | namespace mbed { |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 15 | |
emilmont | 43:e2ed12d17f06 | 16 | /** An ethernet interface, to use with the ethernet pins. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 17 | * |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 18 | * Example: |
emilmont | 43:e2ed12d17f06 | 19 | * @code |
emilmont | 43:e2ed12d17f06 | 20 | * // Read destination and source from every ethernet packet |
emilmont | 43:e2ed12d17f06 | 21 | * |
emilmont | 43:e2ed12d17f06 | 22 | * #include "mbed.h" |
emilmont | 43:e2ed12d17f06 | 23 | * |
emilmont | 43:e2ed12d17f06 | 24 | * Ethernet eth; |
emilmont | 43:e2ed12d17f06 | 25 | * |
emilmont | 43:e2ed12d17f06 | 26 | * int main() { |
emilmont | 43:e2ed12d17f06 | 27 | * char buf[0x600]; |
emilmont | 43:e2ed12d17f06 | 28 | * |
emilmont | 43:e2ed12d17f06 | 29 | * while(1) { |
emilmont | 43:e2ed12d17f06 | 30 | * int size = eth.receive(); |
emilmont | 43:e2ed12d17f06 | 31 | * if(size > 0) { |
emilmont | 43:e2ed12d17f06 | 32 | * eth.read(buf, size); |
emilmont | 43:e2ed12d17f06 | 33 | * printf("Destination: %02X:%02X:%02X:%02X:%02X:%02X\n", |
emilmont | 43:e2ed12d17f06 | 34 | * buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); |
emilmont | 43:e2ed12d17f06 | 35 | * printf("Source: %02X:%02X:%02X:%02X:%02X:%02X\n", |
emilmont | 43:e2ed12d17f06 | 36 | * buf[6], buf[7], buf[8], buf[9], buf[10], buf[11]); |
emilmont | 43:e2ed12d17f06 | 37 | * } |
emilmont | 43:e2ed12d17f06 | 38 | * |
emilmont | 43:e2ed12d17f06 | 39 | * wait(1); |
emilmont | 43:e2ed12d17f06 | 40 | * } |
emilmont | 43:e2ed12d17f06 | 41 | * } |
emilmont | 43:e2ed12d17f06 | 42 | * @endcode |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 43 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 44 | class Ethernet : public Base { |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 45 | |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 46 | public: |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 47 | |
emilmont | 43:e2ed12d17f06 | 48 | /** Initialise the ethernet interface. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 49 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 50 | Ethernet(); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 51 | |
emilmont | 43:e2ed12d17f06 | 52 | /** Powers the hardware down. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 53 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 54 | virtual ~Ethernet(); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 55 | |
simon | 20:029aa53d7323 | 56 | enum Mode { |
simon | 20:029aa53d7323 | 57 | AutoNegotiate |
simon | 20:029aa53d7323 | 58 | , HalfDuplex10 |
simon | 20:029aa53d7323 | 59 | , FullDuplex10 |
simon | 20:029aa53d7323 | 60 | , HalfDuplex100 |
simon | 20:029aa53d7323 | 61 | , FullDuplex100 |
simon | 20:029aa53d7323 | 62 | }; |
simon | 20:029aa53d7323 | 63 | |
emilmont | 43:e2ed12d17f06 | 64 | /** Writes into an outgoing ethernet packet. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 65 | * |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 66 | * It will append size bytes of data to the previously written bytes. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 67 | * |
emilmont | 43:e2ed12d17f06 | 68 | * @param data An array to write. |
emilmont | 43:e2ed12d17f06 | 69 | * @param size The size of data. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 70 | * |
emilmont | 43:e2ed12d17f06 | 71 | * @returns |
emilmont | 43:e2ed12d17f06 | 72 | * The number of written bytes. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 73 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 74 | int write(const char *data, int size); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 75 | |
emilmont | 43:e2ed12d17f06 | 76 | /** Send an outgoing ethernet packet. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 77 | * |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 78 | * After filling in the data in an ethernet packet it must be send. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 79 | * Send will provide a new packet to write to. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 80 | * |
emilmont | 43:e2ed12d17f06 | 81 | * @returns |
emilmont | 43:e2ed12d17f06 | 82 | * 0 if the sending was failed, |
emilmont | 43:e2ed12d17f06 | 83 | * 1 if the package is successfully sent. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 84 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 85 | int send(); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 86 | |
emilmont | 43:e2ed12d17f06 | 87 | /** Recevies an arrived ethernet packet. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 88 | * |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 89 | * Receiving an ethernet packet will drop the last received ethernet packet |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 90 | * and make a new ethernet packet ready to read. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 91 | * If no ethernet packet is arrived it will return 0. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 92 | * |
emilmont | 43:e2ed12d17f06 | 93 | * @returns |
emilmont | 43:e2ed12d17f06 | 94 | * 0 if no ethernet packet is arrived, |
emilmont | 43:e2ed12d17f06 | 95 | * or the size of the arrived packet. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 96 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 97 | int receive(); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 98 | |
emilmont | 43:e2ed12d17f06 | 99 | /** Read from an recevied ethernet packet. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 100 | * |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 101 | * After receive returnd a number bigger than 0it is |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 102 | * possible to read bytes from this packet. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 103 | * Read will write up to size bytes into data. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 104 | * |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 105 | * It is possible to use read multible times. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 106 | * Each time read will start reading after the last read byte before. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 107 | * |
emilmont | 43:e2ed12d17f06 | 108 | * @returns |
emilmont | 43:e2ed12d17f06 | 109 | * The number of byte read. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 110 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 111 | int read(char *data, int size); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 112 | |
emilmont | 43:e2ed12d17f06 | 113 | /** Gives the ethernet address of the mbed. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 114 | * |
emilmont | 43:e2ed12d17f06 | 115 | * @param mac Must be a pointer to a 6 byte char array to copy the ethernet address in. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 116 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 117 | void address(char *mac); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 118 | |
emilmont | 43:e2ed12d17f06 | 119 | /** Returns if an ethernet link is pressent or not. It takes a wile after Ethernet initializion to show up. |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 120 | * |
emilmont | 43:e2ed12d17f06 | 121 | * @returns |
emilmont | 43:e2ed12d17f06 | 122 | * 0 if no ethernet link is pressent, |
emilmont | 43:e2ed12d17f06 | 123 | * 1 if an ethernet link is pressent. |
simon.ford@mbed.co.uk | 18:b3c9f16cbb96 | 124 | * |
simon.ford@mbed.co.uk | 18:b3c9f16cbb96 | 125 | * Example: |
emilmont | 43:e2ed12d17f06 | 126 | * @code |
emilmont | 43:e2ed12d17f06 | 127 | * // Using the Ethernet link function |
emilmont | 43:e2ed12d17f06 | 128 | * #include "mbed.h" |
emilmont | 43:e2ed12d17f06 | 129 | * |
emilmont | 43:e2ed12d17f06 | 130 | * Ethernet eth; |
emilmont | 43:e2ed12d17f06 | 131 | * |
emilmont | 43:e2ed12d17f06 | 132 | * int main() { |
emilmont | 43:e2ed12d17f06 | 133 | * wait(1); // Needed after startup. |
emilmont | 43:e2ed12d17f06 | 134 | * if (eth.link()) { |
emilmont | 43:e2ed12d17f06 | 135 | * printf("online\n"); |
emilmont | 43:e2ed12d17f06 | 136 | * } else { |
emilmont | 43:e2ed12d17f06 | 137 | * printf("offline\n"); |
emilmont | 43:e2ed12d17f06 | 138 | * } |
emilmont | 43:e2ed12d17f06 | 139 | * } |
emilmont | 43:e2ed12d17f06 | 140 | * @endcode |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 141 | */ |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 142 | int link(); |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 143 | |
emilmont | 43:e2ed12d17f06 | 144 | /** Sets the speed and duplex parameters of an ethernet link |
simon | 20:029aa53d7323 | 145 | * |
emilmont | 43:e2ed12d17f06 | 146 | * - AutoNegotiate Auto negotiate speed and duplex |
emilmont | 43:e2ed12d17f06 | 147 | * - HalfDuplex10 10 Mbit, half duplex |
emilmont | 43:e2ed12d17f06 | 148 | * - FullDuplex10 10 Mbit, full duplex |
emilmont | 43:e2ed12d17f06 | 149 | * - HalfDuplex100 100 Mbit, half duplex |
emilmont | 43:e2ed12d17f06 | 150 | * - FullDuplex100 100 Mbit, full duplex |
emilmont | 43:e2ed12d17f06 | 151 | * |
emilmont | 43:e2ed12d17f06 | 152 | * @param mode the speed and duplex mode to set the link to: |
simon | 20:029aa53d7323 | 153 | */ |
simon | 20:029aa53d7323 | 154 | void set_link(Mode mode); |
simon | 20:029aa53d7323 | 155 | |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 156 | }; |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 157 | |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 158 | } // namespace mbed |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 159 | |
rolf.meyer@arm.com | 11:1c1ebd0324fa | 160 | #endif |
emilmont | 27:7110ebee3484 | 161 | |
emilmont | 27:7110ebee3484 | 162 | #endif |