Brief Introduction to Embedded Systems with FPGA and Linux


FPGA Card + H Bridge with motors

Developing the electronics and software for a CNC machine with DC servo motors

The embedded systems, are highly integrated systems.
They usually are fisically very small and with a very reduced consume of energy.
With the entrance in the market of the FPGA's. the embedded systems can be reduced even more, and we can talk about SoC (system on chip).
In other words, all the integrant parts of a computer system as the processor, the memory, and the peripherals, fit in a single chip.
FPGA's are blank chips,they can be programmed and develop the electronic circuit we desire. These circuits can be described with special languajes as VHDL and Verilog.

The system that I'm going to talk in this articles, consists in a card with a FPGA Spartan3 and memory.
Its goal will be the control of a CNC machine with 3 DC motors, and it will be comprised of a microprocessed system that will control 3 PWM's outputs, 3 optical encoders inputs and other purpose auxiliary inputs and outputs, to support the final race sensors, buttons, etc...
es,etc..

To reach these goals we will develop supporting integrated circuits, so this system will behave in a very faster way than a ultimate PC could ever do with software.

Finally, in the software part, we will put the operating system ucLinux to the integrated processor, so the programs that will control the CNC will be almost the same as the developed in the desktop PC's.

The ucLinux operating system is a kernel derivated from Linux but modified to function in processors that lack MMU (memory management unit), we can say that all the process will share the memory, so if one program is bad engineered, it can crash all the system. Fortunately Linux is caracterized by its stability and ucLinux shows very robust.
To complete our system we must acomplish some goals:

  • We must boot uclinux in the system.
  • Configure the drivers of the system's devices (memory mtd,ethernet,keyboard etc..)
  • Create kernel's drivers to control the electronic circuits made by us (pwm circuit,encoders,buttons,vga)
  • Create the user mode program. In our case, we will port the EMC2 program to our system.

    Hardware

    I will create multiple circuits to this fpga, these will be:

  • PowerPC Microblaze 32 bits Processor
  • keyboard interface PS/2
  • Mac Ethernet 10/100
  • Memory DDR controller
  • Cache memory for data and instruccions (8ks)
  • LCD output
  • VGA output for a monitor
  • PWM outputs to feed the power stages of the 3 motors (puente H)
  • Logical interface for the inputs of the optical encoders

    The card also must have some DDR memory for the use of the processor, and some flash memory to configure the fpga and store the uclinux kernel and programs.

  • DDR Memory 32 Megabytes
  • Flash Serial Memory 16 Megabytes

    Software

  • U-boot to boot the kernel
  • kernel UcLinux 2.4.32 with IP support , fat support, SD memory, etc...
  • User level software uclinuxdist with busybox, etc...
  • kernel drivers for pwm circuits and optical encoders
  • EMC2 from linuxcnc

    Advanced configurations

    Special needings, response times.

    Linux is not engineered to control events in real time, it's engineered to be very efficient doing a lot of tasks at the same time, and to be good in this, having to answer in real time to certain events can have a very negative impact in the general speed of the system.
    In the embedded world, the goals are very different, sometimes we need that the system reacts in a very short and deterministic frame of time.
    The linux kernel 2.6 has enhanced a lot these aspects, but when a hard realtime is needed, the better approach is patch the linux kernel with the rtai or rtlinux code.
    These make that the true brain of the system is a microkernel prepared for realtime tasks, and linux becomes a normal process without true priorities
    In this way we can code a realtime process that controls one hardware interruption, and the rest of tipical tasks of linux, as the networking, devices, etc..are executed with a lower priority

    Uclinux Bootlog, booting the card with a Microblaze softprocessor

    Linux version 2.4.32-uc0 (root@trastu) (gcc version 3.4.1 ( Xilinx EDK 8.1.01 Build EDK_I.19.4 080506 )) #15 Wed Mar 28 12:49:45 CEST 2007
    On node 0 totalpages: 8192
    zone(0): 8192 pages.
    zone(1): 0 pages.
    zone(2): 0 pages.
    CPU: MICROBLAZE
    Kernel command line: mtdparts=physmap_auto:256K(boot),256K(bootenv),256K(config), 4M(image),11M(spare) macaddr=00:0a:35:00:22:01
    Console: xmbserial on UARTLite
    Calibrating delay loop... 32.97 BogoMIPS
    Memory: 32MB = 32MB total
    Memory: 29692KB available (624K code, 2090K data, 36K init)
    Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
    Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
    Mount cache hash table entries: 512 (order: 0, 4096 bytes)
    Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
    Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
    POSIX conformance testing by UNIFIX
    Linux NET4.0 for Linux 2.4
    Based upon Swansea University Computer Society NET3.039
    Microblaze UARTlite serial driver version 1.00
    ttyS0 at 0x40600000 (irq = 2) is a Microblaze UARTlite
    Starting kswapd
    RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
    physmap_auto flash device: 1000000 at 21000000
    physmap_auto probing buswidth 1
    cfi_cmdset_0001: Erase suspend on write enabled
    0: offset=0x0,size=0x20000,blocks=128
    Using buffer write method
    physmap_auto: Using Command Line partition definition
    Creating 5 MTD partitions on "Physically mapped flash":
    0x00000000-0x00040000 : "boot"
    0x00040000-0x00080000 : "bootenv"
    0x00080000-0x000c0000 : "config"
    0x000c0000-0x004c0000 : "image"
    0x004c0000-0x00fc0000 : "spare"
    uclinux[mtd]: RAM probe address=0x220d3a3c size=0x1d3000
    uclinux[mtd]: root filesystem index=6
    MicroBlaze auto-config flash probe(0x21000000,8388608,4): 800000 at 21000000
    CFI: Found no Flash device at location zero
    Search for id:(1818 00) interleave(2) type(2)
    Search for id:(1818 00) interleave(2) type(2)
    Search for id:(1818 00) interleave(2) type(2)
    Search for id:(18 18) interleave(2) type(1)
    Search for id:(18 18) interleave(2) type(1)
    Search for id:(18 18) interleave(2) type(1)
    Search for id:(1818 00) interleave(4) type(2)
    Search for id:(1818 00) interleave(4) type(2)
    Search for id:(1818 00) interleave(4) type(2)
    Search for id:(18 00) interleave(4) type(1)
    Search for id:(18 00) interleave(4) type(1)
    Search for id:(18 00) interleave(4) type(1)
    JEDEC: Found no Flash device at location zero
    MicroBlaze auto-config ram probe(0x220d3a3c,1912832,4): 1d3000 at 220d3a3c
    Creating 1 MTD partitions on "RAM":
    0x00000000-0x001d3000 : "Romfs"
    VFS: Mounted root (cramfs filesystem) readonly.
    Freeing init memory: 36K
    Mounting proc:
    Mounting var:
    Populating /var:
    Running local start scripts.
    Mounting /etc/config:
    Populating /etc/config:
    flatfsd: invalid header magic
    flatfsd: Nonexistent or bad flatfs (-183), creating new one...
    flatfsd: Wrote 232 bytes to flash in 2 seconds
    flatfsd: Created 4 configuration files (124 bytes)
    Setting hostname:

    Embedded login: root
    Password:
    # ls
    bin dev etc home lib mnt proc sbin tmp usr var
    #

    Links:

    Empresas de FPGA

    Xilinx
    Altera

    Linux in microblaze

    Petalinux

    Free Cores

    OpenCores

  • cell phone cell phone apple

    cell phone cell phone apple accessories apple accessories phone zoom phone zoom phone on sale phone on sale wedding dresse shop wedding dresse shop wedding planning wedding planning best hair best hair nest match nest match iphone wireless iphone wireless iphone revolution iphone revolution wedding invitation wedding invitation jean style jean style urban jean style urban jean style wedding dresse show wedding dresse show iphone on sale iphone on sale cell phone club cell phone club ugg supermarket ugg supermarket asian tulips asian tulips easy web zone easy web zone p90x p90x wedding gowns guide wedding gowns guide wedding dress world wedding dress world wedding dress on sale wedding dress on sale crazy uggs crazy uggs chloe outlet chloe outlet chloe on sale chloe on sale tiffany world tiffany world cheap ugg boots cheap ugg boots ed hardy shop ed hardy shop tiffany sale tiffany sale ugg biz ugg biz ugg fan ugg fan ugg india ugg india free shipping uggs free shipping uggs ugg store ugg store tiffany cousa tiffany cousa austro ugg austro ugg ugg store ugg store high quality replica high quality replica christian shop christian shop ugg austro ugg austro

    http://www.authenticuggboots.

    http://www.authenticuggboots.com.au/

    uggsuggs
    womens uggs womens uggs
    ugg boots ugg boots
    ugg boots saleugg boots sale
    classic short ugg bootclassic short ugg boot
    ugg sale ugg sale
    cheap ugg bootscheap ugg boots
    classic tall ugg boots classic tall ugg boots
    classic mini ugg boots classic mini ugg boots
    ugg australia ugg australia
    uggs boots uggs boots
    winter boots winter boots
    uggs on sale uggs on sale
    discount ugg boots discount ugg boots
    ultra tall ugg boots ultra tall ugg boots
    ultra short ugg boots ultra short ugg boots
    ugg boots 2010 ugg boots 2010
    cheap uggs cheap uggs
    australia ugg boots australia ugg boots
    bailey button ugg boots bailey button ugg boots
    classic cardy ugg boots classic cardy ugg boots
    metallic ugg boots metallic ugg boots
    nightfall ugg bootsnightfall ugg boots
    sundance ii ugg boots sundance ii ugg boots
    sheepskin boots sheepskin boots
    sheepskin ugg boots sheepskin ugg boots
    ugg boots womensugg boots womens
    womens ugg bootswomens ugg boots
    ugg boots sydneyugg boots sydney
    ugg boots melbourne ugg boots melbourne
    ugg boots brisbaneugg boots brisbane
    ugg boots perth ugg boots perth
    ugg boots adelaideugg boots adelaide
    ugg boots retailersugg boots retailers

    In Fashion thomas saboThis

    In Fashion thomas saboThis Week . . .Links Of London is a new thomas sabo charms that will appear Abercrombie And Fitch on Possess Your Links Of London to help keep Lace Wigs in the Full Lace Wigs on the Lace Front Wigs and greatest in the fashion Pandora Bracelets. Let me know what Pandora Jewelry think of it – I love Pandora read your P90x. And if you read an P90x Workout that you think others should know P90x Reviews, Insainity be sure to let me Insanity Workout and I’ll add it in my weekly Insanity Workout DVDS
    They’re working on a Insainity Workout Reviews protection P90x that has the Abercrombie And Fitch to P90x Workout stores like the WSJ P90x Reviews!

    cheers!

    bonjour!

    bonjour!

    GrEeTiNgS, efulki! kaufen viagra online