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
Diff: InterruptManager.h
- Revision:
- 66:9c8f0e3462fb
- Parent:
- 65:5798e58a58b1
diff -r 5798e58a58b1 -r 9c8f0e3462fb InterruptManager.h --- a/InterruptManager.h Mon Aug 12 13:17:46 2013 +0300 +++ b/InterruptManager.h Mon Aug 19 13:34:54 2013 +0300 @@ -1,143 +1,143 @@ -#ifndef MBED_INTERRUPTMANAGER_H -#define MBED_INTERRUPTMANAGER_H - -#include "cmsis.h" -#include "CallChain.h" -#include <string.h> - -namespace mbed { - -/** Use this singleton if you need to chain interrupt handlers. - * - * Example (for LPC1768): - * @code - * #include "InterruptManager.h" - * #include "mbed.h" - * - * Ticker flipper; - * DigitalOut led1(LED1); - * DigitalOut led2(LED2); - * - * void flip(void) { - * led1 = !led1; - * } - * - * void handler(void) { - * led2 = !led1; - * } - * - * int main() { - * led1 = led2 = 0; - * flipper.attach(&flip, 1.0); - * InterruptManager::get()->add_handler(handler, TIMER3_IRQn); - * } - * @endcode - */ -class InterruptManager { -public: - /** Return the only instance of this class - */ - static InterruptManager* get(); - - /** Destroy the current instance of the interrupt manager - */ - static void destroy(); - - /** Add a handler for an interrupt at the end of the handler list - * - * @param function the handler to add - * @param irq interrupt number - * - * @returns - * The function object created for 'function' - */ - pFunctionPointer_t add_handler(void (*function)(void), IRQn_Type irq) { - return add_common(function, irq); - } - - /** Add a handler for an interrupt at the beginning of the handler list - * - * @param function the handler to add - * @param irq interrupt number - * - * @returns - * The function object created for 'function' - */ - pFunctionPointer_t add_handler_front(void (*function)(void), IRQn_Type irq) { - return add_common(function, irq, true); - } - - /** Add a handler for an interrupt at the end of the handler list - * - * @param tptr pointer to the object that has the handler function - * @param mptr pointer to the actual handler function - * @param irq interrupt number - * - * @returns - * The function object created for 'tptr' and 'mptr' - */ - template<typename T> - pFunctionPointer_t add_handler(T* tptr, void (T::*mptr)(void), IRQn_Type irq) { - return add_common(tptr, mptr, irq); - } - - /** Add a handler for an interrupt at the beginning of the handler list - * - * @param tptr pointer to the object that has the handler function - * @param mptr pointer to the actual handler function - * @param irq interrupt number - * - * @returns - * The function object created for 'tptr' and 'mptr' - */ - template<typename T> - pFunctionPointer_t add_handler_front(T* tptr, void (T::*mptr)(void), IRQn_Type irq) { - return add_common(tptr, mptr, irq, true); - } - - /** Remove a handler from an interrupt - * - * @param handler the function object for the handler to remove - * @param irq the interrupt number - * - * @returns - * true if the handler was found and removed, false otherwise - */ - bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq); - -private: - InterruptManager(); - ~InterruptManager(); - - // We declare the copy contructor and the assignment operator, but we don't - // implement them. This way, if someone tries to copy/assign our instance, - // he will get an error at compile time. - InterruptManager(const InterruptManager&); - InterruptManager& operator =(const InterruptManager&); - - template<typename T> - pFunctionPointer_t add_common(T *tptr, void (T::*mptr)(void), IRQn_Type irq, bool front=false) { - int irq_pos = get_irq_index(irq); - bool change = must_replace_vector(irq); - - pFunctionPointer_t pf = front ? _chains[irq_pos]->add_front(tptr, mptr) : _chains[irq_pos]->add(tptr, mptr); - if (change) - NVIC_SetVector(irq, (uint32_t)&InterruptManager::static_irq_helper); - return pf; - } - - pFunctionPointer_t add_common(void (*function)(void), IRQn_Type irq, bool front=false); - bool must_replace_vector(IRQn_Type irq); - int get_irq_index(IRQn_Type irq); - void irq_helper(); - void add_helper(void (*function)(void), IRQn_Type irq, bool front=false); - static void static_irq_helper(); - - CallChain* _chains[NVIC_NUM_VECTORS]; - static InterruptManager* _instance; -}; - -} // namespace mbed - -#endif - +#ifndef MBED_INTERRUPTMANAGER_H +#define MBED_INTERRUPTMANAGER_H + +#include "cmsis.h" +#include "CallChain.h" +#include <string.h> + +namespace mbed { + +/** Use this singleton if you need to chain interrupt handlers. + * + * Example (for LPC1768): + * @code + * #include "InterruptManager.h" + * #include "mbed.h" + * + * Ticker flipper; + * DigitalOut led1(LED1); + * DigitalOut led2(LED2); + * + * void flip(void) { + * led1 = !led1; + * } + * + * void handler(void) { + * led2 = !led1; + * } + * + * int main() { + * led1 = led2 = 0; + * flipper.attach(&flip, 1.0); + * InterruptManager::get()->add_handler(handler, TIMER3_IRQn); + * } + * @endcode + */ +class InterruptManager { +public: + /** Return the only instance of this class + */ + static InterruptManager* get(); + + /** Destroy the current instance of the interrupt manager + */ + static void destroy(); + + /** Add a handler for an interrupt at the end of the handler list + * + * @param function the handler to add + * @param irq interrupt number + * + * @returns + * The function object created for 'function' + */ + pFunctionPointer_t add_handler(void (*function)(void), IRQn_Type irq) { + return add_common(function, irq); + } + + /** Add a handler for an interrupt at the beginning of the handler list + * + * @param function the handler to add + * @param irq interrupt number + * + * @returns + * The function object created for 'function' + */ + pFunctionPointer_t add_handler_front(void (*function)(void), IRQn_Type irq) { + return add_common(function, irq, true); + } + + /** Add a handler for an interrupt at the end of the handler list + * + * @param tptr pointer to the object that has the handler function + * @param mptr pointer to the actual handler function + * @param irq interrupt number + * + * @returns + * The function object created for 'tptr' and 'mptr' + */ + template<typename T> + pFunctionPointer_t add_handler(T* tptr, void (T::*mptr)(void), IRQn_Type irq) { + return add_common(tptr, mptr, irq); + } + + /** Add a handler for an interrupt at the beginning of the handler list + * + * @param tptr pointer to the object that has the handler function + * @param mptr pointer to the actual handler function + * @param irq interrupt number + * + * @returns + * The function object created for 'tptr' and 'mptr' + */ + template<typename T> + pFunctionPointer_t add_handler_front(T* tptr, void (T::*mptr)(void), IRQn_Type irq) { + return add_common(tptr, mptr, irq, true); + } + + /** Remove a handler from an interrupt + * + * @param handler the function object for the handler to remove + * @param irq the interrupt number + * + * @returns + * true if the handler was found and removed, false otherwise + */ + bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq); + +private: + InterruptManager(); + ~InterruptManager(); + + // We declare the copy contructor and the assignment operator, but we don't + // implement them. This way, if someone tries to copy/assign our instance, + // he will get an error at compile time. + InterruptManager(const InterruptManager&); + InterruptManager& operator =(const InterruptManager&); + + template<typename T> + pFunctionPointer_t add_common(T *tptr, void (T::*mptr)(void), IRQn_Type irq, bool front=false) { + int irq_pos = get_irq_index(irq); + bool change = must_replace_vector(irq); + + pFunctionPointer_t pf = front ? _chains[irq_pos]->add_front(tptr, mptr) : _chains[irq_pos]->add(tptr, mptr); + if (change) + NVIC_SetVector(irq, (uint32_t)&InterruptManager::static_irq_helper); + return pf; + } + + pFunctionPointer_t add_common(void (*function)(void), IRQn_Type irq, bool front=false); + bool must_replace_vector(IRQn_Type irq); + int get_irq_index(IRQn_Type irq); + void irq_helper(); + void add_helper(void (*function)(void), IRQn_Type irq, bool front=false); + static void static_irq_helper(); + + CallChain* _chains[NVIC_NUM_VECTORS]; + static InterruptManager* _instance; +}; + +} // namespace mbed + +#endif +