Difference between revisions of "Multi-purpose Embedded System"

From OpenCircuits
Jump to navigation Jump to search
 
(22 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
This project intends to provide ideas and technical information to create a multi-purpose embedded system.
 +
*Information contained in this wiki should be as generic as possible (unless otherwise stated) so that the ideas and information can be portable to different hardware (e.g. 8-bit/16-bit/32-bit MCU).
 +
*The peripheral devices should be expandable
 +
 
==Hardware Architecture==
 
==Hardware Architecture==
 
[[Image:Mpes hw archi.png]]
 
[[Image:Mpes hw archi.png]]
*MCU
+
 
**MCU can be 8-bit/16-bit/32-bit
+
===MCU===
**MCU should have sufficient RAM (i.e. no external RAM required)
+
*MCU can be 8-bit/16-bit/32-bit
**MCU should have program Flash (i.e. no external program flash required)
+
*MCU should have sufficient RAM (i.e. no external RAM required)
*Data Memory
+
*MCU should have program Flash (i.e. no external program flash required)
**Use serial bus (I2C/SPI) to expand data memory to save I/O pins
+
 
**Need a file system to access the data
+
 
**EEPROM for small block of re-writable data
+
===Data Memory===
**Flash for large block of re-writable data
+
*Use serial bus (I2C/SPI) to expand data memory to save I/O pins
*Communication
+
*Need a file system to access the data
**RS232 for short distance one-to-one communication with PC
+
*EEPROM for small block of re-writable data
**RS485 for longer distance networked communication
+
*Flash for large block of re-writable data
**USB for USB communication with PC
+
 
**Ethernet for Internet connectivity
+
 
**GPIB for automated test equipment
+
===Communication===
*User Interface
+
*RS232 for short distance communication with PC
**Graphical displays (LCD, VFD, etc.)
+
*RS485 for longer distance communication (upto 1200m) over a set of devices
**Keypad for input
+
*USB for USB communication with PC
*Sensory Control
+
*Ethernet for Internet connectivity
**ADC for analog feedback signals
+
**Use of Ethernet controller (e.g. [http://www.davicom.com.tw/userfile/24247/DM9000A-DS-F01-101906.pdf DM9000A] (requiring software TCP/IP stack)
**DAC for analog control signals
+
**User of TCP/IP chip (e.g. [http://www.wiznet.co.kr/ W5300])
**GPIO for digital feedback and control signals
+
*GPIB for automated test equipment
 +
 
 +
 
 +
===User Interface===
 +
*Graphical displays (LCD, VFD, etc.)
 +
*Keypad for input
 +
 
 +
 
 +
===Sensory Control===
 +
*ADC for analog feedback signals
 +
**Requires anti-aliasing analog filters and op-amp circuits
 +
***Use desktop software (e.g. [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010007 FilterLab]) to design circuits
 +
**May incorporate [http://www-users.cs.york.ac.uk/~fisher/mkfilter/ digital filter] to improve reduce noise
 +
*DAC for analog control signals
 +
**Refer to [[Modulation_Plugin | here]] if modulation is needed.
 +
*GPIO for digital feedback and control signals
 +
**Option 1: directly controlled by MCU
 +
**Option 2: indirectly through D-type flip-flops (e.g. [http://www.datasheetcatalog.org/datasheet/philips/74lv574.pdf 74LV574]) for low pin counts MCU
 +
**Option 3: indirectly through shift register flip-flops (e.g. [http://www.standardics.nxp.com/products/lv/datasheet/74lv165.pdf 74LV165] for input, [http://www.datasheetcatalog.org/datasheet/texasinstruments/tpic6595.pdf TPIC6595] or [http://www.nxp.com/acrobat_download/datasheets/74LV595_3.pdf 74LV595] for output ) for extremely low pin count MCU
  
  
Line 39: Line 61:
 
     Hardware    | UART | ADC | DAC | NVM | PWM | ... |  TIMERS  |  
 
     Hardware    | UART | ADC | DAC | NVM | PWM | ... |  TIMERS  |  
 
                 +------+-----+-----+-----+-----+-----+----------+
 
                 +------+-----+-----+-----+-----+-----+----------+
*The task scheduler is based on [http://www.freertos.org/ FreeRTOS] V4.1.3 incorporating coroutine developed by [http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html Simon Tatham]. The scheduler API is wrapped by the [http://www.die.net/doc/linux/man/man2/ POSIX] Thread API.
+
*See [[Freertos_posix_Development | here]] for description
**e.g. pthread_create(), usleep(), etc.
 
*Software drivers are developed to allow users at Application Level to use the hardware (e.g. ADC, DAC, UART, NVM etc) through the [http://www.die.net/doc/linux/man/man2/ POSIX] System call API.
 
**e.g. open(), write(), read(), ioctl(), lseek(), etc.
 
*The most up-to-date development can be found at repository [http://chungyan5.no-ip.org/vc/?root=freertos_posix freertos_posix]
 
  
  
 +
===GUI===
 
                       +---------------+----------------+
 
                       +---------------+----------------+
 
   User Applications    | Application 1 | Application 2  |
 
   User Applications    | Application 1 | Application 2  |
Line 57: Line 76:
 
   Drivers & Scheduler  |  Display  |  Pointer  |  Keypad  | Task Scheduler |
 
   Drivers & Scheduler  |  Display  |  Pointer  |  Keypad  | Task Scheduler |
 
                       +-----------+-----------+----------+----------------+
 
                       +-----------+-----------+----------+----------------+
*See [http://chungyan5.no-ip.org/wiki/index.php/UI here] for description
 
  
  
Line 67: Line 85:
 
                   | Server |      |      | Resolver |      |    |                    |      |
 
                   | Server |      |      | Resolver |      |    |                    |      |
 
                   +--------+------+------+----------+------+----+                    |      |
 
                   +--------+------+------+----------+------+----+                    |      |
   Socket API      |             Linux-like Socket             |                    |      |
+
   Socket API      |           Linux Socket Wrapper            |                    |      |
                   +---------------------------------------------+                    |      |
+
                   |          +----------------------------------+                    |      |
   TCP/IP Stack    |                   uip                       |                    |      |
+
   TCP/IP Stack    |         |              uip               |                    |      |
                   +---------------------------------------------+                    |      |
+
                   |          +----------------------------------+                    |      |
                   |             Ethernet Controller            |                    |      |
+
                   |         |      Ethernet Thread            |                    |      |
                   +--------------------------------------+------+--------------------+-------+
+
                   |          +---------------------------+------+--------------------+-------+
   POSIX API        |           POSIX System Calls         |            POSIX Threads          |
+
   POSIX API        |         |    POSIX System Calls     |            POSIX Threads          |
                   +--------------------------------------+-----------------------------------+
+
                   +----------+---------------------------+-----------------------------------+
 
                   |              Drivers                |            Task Scheduler        |
 
                   |              Drivers                |            Task Scheduler        |
                   +--------------------------------------+-----------------------------------+
+
                   +----------+---------------------------+-----------------------------------+
*See [http://www.opencircuits.com/Ethernet_Module here] for description
+
                  |  H/W    |
 +
                  |  TCP/IP  |
 +
                  |  Stack  |
 +
                  +----------+
 +
*See [[Ethernet_Module | here]] for description
 +
 
 +
 
 +
===File System===
 +
                  +------------+------------+------------+------------+------------+------------+
 +
Application      |  App 1    |  App 2    |  App 3    |  App 4    |  App 5    |  App 6    |
 +
                  +------------+------+-----+------------+------------+------------+------------+
 +
POSIX API        |          POSIX System Calls          |            POSIX Threads            |
 +
                  +--------------------+                |                                      |
 +
                  |  FatFs Wrapper    |                |                                      |
 +
                  +--------------------+                |                                      |
 +
File System      |      FatFs        |                |                                      |
 +
                  +--------+-----+-----+-----------------+--------------------------------------+
 +
                  | EEPROM | MMC | USB |    Drivers      |            Task Scheduler            |
 +
                  +--------+-----+-----+-----------------+--------------------------------------+
 +
*See [[MMC_Card_Reader | here]] for description
 +
 
 +
[[category:projects]]

Latest revision as of 00:47, 31 August 2009

This project intends to provide ideas and technical information to create a multi-purpose embedded system.

  • Information contained in this wiki should be as generic as possible (unless otherwise stated) so that the ideas and information can be portable to different hardware (e.g. 8-bit/16-bit/32-bit MCU).
  • The peripheral devices should be expandable

Hardware Architecture[edit]

Mpes hw archi.png

MCU[edit]

  • MCU can be 8-bit/16-bit/32-bit
  • MCU should have sufficient RAM (i.e. no external RAM required)
  • MCU should have program Flash (i.e. no external program flash required)


Data Memory[edit]

  • Use serial bus (I2C/SPI) to expand data memory to save I/O pins
  • Need a file system to access the data
  • EEPROM for small block of re-writable data
  • Flash for large block of re-writable data


Communication[edit]

  • RS232 for short distance communication with PC
  • RS485 for longer distance communication (upto 1200m) over a set of devices
  • USB for USB communication with PC
  • Ethernet for Internet connectivity
    • Use of Ethernet controller (e.g. DM9000A (requiring software TCP/IP stack)
    • User of TCP/IP chip (e.g. W5300)
  • GPIB for automated test equipment


User Interface[edit]

  • Graphical displays (LCD, VFD, etc.)
  • Keypad for input


Sensory Control[edit]

  • ADC for analog feedback signals
    • Requires anti-aliasing analog filters and op-amp circuits
      • Use desktop software (e.g. FilterLab) to design circuits
    • May incorporate digital filter to improve reduce noise
  • DAC for analog control signals
    • Refer to here if modulation is needed.
  • GPIO for digital feedback and control signals
    • Option 1: directly controlled by MCU
    • Option 2: indirectly through D-type flip-flops (e.g. 74LV574) for low pin counts MCU
    • Option 3: indirectly through shift register flip-flops (e.g. 74LV165 for input, TPIC6595 or 74LV595 for output ) for extremely low pin count MCU


Software Architecture[edit]

RTOS[edit]

               +-----------+-----------+----------------------------------------------+
 Application   |  Task 1   |  Task 2   |    ...                                       |
               +-----------+-----------+------------+----------------------+----------+
 Standard API  |          POSIX System Call         |     POSIX Thread     |  C-Lib   |
               +------------------+-----------------+----------------------+----------+
   Kernel      | Power Management |                 |    Task Scheduler    |
               +------------------+                 +----------+-----------+ 
               |               Drivers              | FreeRTOS | Coroutine |
               +------+-----+-----+-----+-----+-----+----------+-----------+
   Hardware    | UART | ADC | DAC | NVM | PWM | ... |  TIMERS  | 
               +------+-----+-----+-----+-----+-----+----------+


GUI[edit]

                      +---------------+----------------+
 User Applications    | Application 1 | Application 2  |
                      |               +----------------+------------------+
   Middlewares        |               |    Toolkits    |  Window Manager  |
                      +---------------+----------------+------------------+
   GUI Library        |            Graphics Engine (inc Font)             |
                      +-----------+----------------------+----------------+
   POSIX API          |           |  POSIX System Calls  | POSIX Threads  |
                      |           +-----------+----------+----------------+
 Drivers & Scheduler  |  Display  |  Pointer  |  Keypad  | Task Scheduler |
                      +-----------+-----------+----------+----------------+


TCP/IP Stack[edit]

                  +---------------------------------------------+--------------------+-------+
 Applications     |            Ethernet Application             |  GUI Application   |  ...  |
                  +--------+------+------+----------+------+----+                    |       |
 Web Libraries    |  Web   | DHCP | SNMP |   DNS    | SMTP |... |                    |       |
                  | Server |      |      | Resolver |      |    |                    |       |
                  +--------+------+------+----------+------+----+                    |       |
 Socket API       |            Linux Socket Wrapper             |                    |       |
                  |          +----------------------------------+                    |       |
 TCP/IP Stack     |          |               uip                |                    |       |
                  |          +----------------------------------+                    |       |
                  |          |       Ethernet Thread            |                    |       |
                  |          +---------------------------+------+--------------------+-------+
 POSIX API        |          |    POSIX System Calls     |            POSIX Threads          |
                  +----------+---------------------------+-----------------------------------+
                  |               Drivers                |            Task Scheduler         |
                  +----------+---------------------------+-----------------------------------+
                  |   H/W    |
                  |  TCP/IP  |
                  |  Stack   |
                  +----------+


File System[edit]

                 +------------+------------+------------+------------+------------+------------+
Application      |   App 1    |   App 2    |   App 3    |   App 4    |   App 5    |   App 6    |
                 +------------+------+-----+------------+------------+------------+------------+
POSIX API        |          POSIX System Calls          |            POSIX Threads             |
                 +--------------------+                 |                                      |
                 |   FatFs Wrapper    |                 |                                      |
                 +--------------------+                 |                                      |
File System      |       FatFs        |                 |                                      |
                 +--------+-----+-----+-----------------+--------------------------------------+
                 | EEPROM | MMC | USB |    Drivers      |            Task Scheduler            |
                 +--------+-----+-----+-----------------+--------------------------------------+