dimmPCITM 68VZ328 Hardware / Software Manual www.amctechcorp.com AMC Technologies Corporation, July 2003 Revision 0.5.3 for SDK 2.05 Linux Kernel 2.
Copyright notice dimmPCITM System Development Kit CD-Rom, the text and graphics used in this manual, its cover, CD-Rom artwork, dimmPCITM / Passive Backplane circuit board artwork and the box artwork represent proprietary, patentable and copyrighted materials and are protected from misuse under local and international laws. All rights are reserved. AMC Technologies Corporation has license to reproduce this work. All rights reserved.
NETdimm Developers Kit Quick Start Guide This document is provided to help users bring up the NETdimm Developers Kit hardware and software as quickly as possible. If difficulties are encountered using this guide please refer to the complete instruction manual. 1. 2. 3. 4. 5. 6. 7. 8. Find a static-free work area to use and remove the dimmPCI Developers Backplane, NETdimm, IOdimm and POWERdimm from their static protective bags.
computer. 9. Ensure the EMU BRK jumper is not installed. 10. Open the Linux “minicom” application. Select the serial port attached to the development kit and configure the port for 115.2 kbps and 8N1 serial protocol. Power up the wall adapter. The terminal window will act as the controlling console for the NETdimm. 11. After booting up, the console will display a login prompt, as is shown below /etc/issue 2002 www.dimmpci.
www.amctechcorp.
This page left intentionally blank 6 www.amctechcorp.
1 Introduction Launching Linux at the embedded The modern world runs on computers and technology. Every corner you turn, every road you travel, computers are helping you get there. Embedded systems are the fuel in these computers and the lifeblood of modern-day electronics. So what is an embedded system? An embedded system is a combination of computer hardware and software, and perhaps additional mechanical or other parts, designed to perform a dedicated function.
Besides all of the impressive features of Linux, it is also openly available in several different arrangements and configurations. This diverse array of compatibility of Linux and its supporting software has evolved to the needs of the market and applications of which Linux is being adapted. One of the most interesting qualities of embedded Linux is the abundance of architectures that it is compatible with. Linux has been ported to such architectures as x86, MIPS, and the PowerPC.
What’s on the CD? On the CD you will find: µClinux source files with patches to work on the dimmPCITM platform. GCC cross compiler tools for the DragonBall processor, with the necessary library files included. • Tools for use under µClinux on the target board, along with source code. • A flash loader program, to reprogram the board with new image files. • Sample applications to show the capabilities of the dimmPCITM development kit.
This page left intentionally blank 10 www.amctechcorp.
2 dimmPCITM uC68VZ328 Embedded Microcontroller Features CPU Module • • • • • • • • • • • • • • • Powerful 33 MHz DragonBall microprocessor Up to 32 Mbytes SDRAM Up to 8 Mbytes Simultaneous Flash Memory Up to 1kbyte of serial EEPROM 168 pin DIMM form factor Less than 500 mW power dissipation Real Time Clock Dallas Watchdog Timer On board µClinux OS including TCP/IP 2 serial ports Proposed dimmPCITM standard bus Proposed dimmSPITM standard bus 33 MHz PCI performance 32 bit PCI data transfers Ethernet inter
General Description AMC Technologies Corporation (AMC) has developed the proposed dimmPCI™ standards specification which defines electrical signaling and mechanical specifications for a new generation of low cost Peripheral Component Interconnect (PCI) compatible devices. DimmPCI™ is an adaptation of the PCI Specification 2.1 for embedded applications. All dimmPCI™ cards are peripheral interface cards that install directly on a low cost backplane.
The Dragonball dimmPCI™ CPU module supports Ethernet 10BaseT, two serial ports, and a graphical “PDA style” LCD interface. The module conforms to the proposed dimmPCI™ standard and may be used with a complementary array of other modules on a dimmPCI™ backplane. These expansion cards include a COMM module that supports dual Ethernet 10/100BaseT channels and CAN communications, a DAIO module that supports digital and analog I/O, and a power supply module.
Architecture 68EC000 HCMOS STATIC CORE PWM TIMER SPI UART LCD NETdimm RS-485 MC68VZ328 RS-232 FLASH EE PCI SDRAM ETHERNET RTC Figure 1. CPU Architecture DIMM DIMM RJ-45 ETHERNET BATTERY PCI DIMM USB RS-232 LCD Figure 2. Backplane Architecture 14 www.amctechcorp.
The CPU Architecture consists of 4 main functional regions. The Ethernet Controller, the PCI Interface, the MCU Core and System Memory. These regions form a highly integrated embedded system. The Backplane Architecture consists of 3 main regions. The Communication Connectors, the DIMM and PCI Slots and the LCD Connector. These regions complete the dimmPCITM system.
The RTL8019 ethernet chip supports either 8/16-bit interfaces, but because most NE2000 compatible drivers have been written for an 8-bit interface, the device has been interfaced as an 8-bit device attached to CSA1, the last available chip select. Since the chip select pair must be configured as 16-bit to support the 16-bit flash, the registers of the ethernet chip will appear at every other byte address rather than a block of contiguous bytes.
A portion of the Flash has been allocated for use with the Journaling Flash File System (JFFS). The JFFS is mounted under the ‘/usr/’ directory in the standard µClinux distribution. For more information on the JFFS consult Appendix B. The rest of the Flash contains the read-only file system. 10000000 Linux Kernel Read-Only File System JFFS Figure 4.
to its working position in the memory map and to initialize SDRAM to address 0x00000000. SDRAM The SDRAM used on the dimmPCITM is the MT48LC4M16A2 or compatible 3.0V SDRAM. The exact SDRAM part or size is dependant on the current SDRAM in stock or available on the market. The SDRAM is located at 0x00000000 in memory so that the interrupt vector table will be located in SDRAM.
Ethernet Controller The dimmPCITM contains an on board RealTek RTL8019AS Ethernet controller and all the supporting circuitry to implement a 10BaseT ethernet port with no external components. The drivers have been written and implemented by the µClinux operating system running on the dimmPCITM. No support is provided with the exception of the AMC Technologies Corporation provided IEEE assigned MAC address. Below shows how the MAC address can be obtained.
Figure 6. NETdimm Ethernet Schematic 20 www.amctechcorp.
Digital I/O The Motorola MC68VZ328 processor provides numerous general purpose I/O lines to the dimmPCITM. The lines which have not been assigned to their dedicated functions can be used for digital I/O. Depending on the options compiled into the kernel, a number of pins on the dimmPCITM module can be used for digital I/O. The configuration procedure for setting up the digital I/O functions is outlined in Appendix D1. IOdimm The IOdimm module can be used as a stand-alone or as a peripheral dimmPCI device.
Figure 7.1 Digital Output Schematic Figure 7.2 Digital Input Schematic 22 www.amctechcorp.
Figure 7.3 Analog Output Schematic www.amctechcorp.
Figure 7.4 Analog Input Schematic Figure 7.5 Analog to Digital Converter Schematic 24 www.amctechcorp.
Figure 7.
RS-232 The dimmPCITM provides a 10-pin header terminal RS232 port on the backplane capable of running at up to 230400bps. RS232 line drivers are integrated and no external components are required. The RTS and CTS lines are usable on the DCE configuration of the RS232 port. The DCD (Data Carrier Detect), DSR (Data Set Ready) and DTR (Data Transmit Ready) lines are not implemented on the dimmPCITM and are all connected to each other.
Multiple processes may be individually registered with the watchdog, each providing its own timeout time. Each process must update the watchdog within its own timeout interval or the system will reset. • A process may unregister itself at any time. • At least one process must register with the watchdog within 3 minutes of bootup or else the watchdog will reset the system.
SPI A standard SPI bus is included on the dimmPCITM. This SPI bus is located on the DIMM socket occupying pins 23-29 on both the A and B-sides. The SPI bus allows developers the opportunity to create their own DIMM socket cards containing SPI devices and the availability to interface these cards with the dimmPCITM. The SPI bus provides an easy and affordable low-cost alternative to PCI. However the SPI can only be used in low-bandwidth applications.
dimmPCITM Signal Descriptions P in # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 SideA ET HRXET HRX+ SideB ET HT XET HT X+ ET HLNKLED VBAT P /D EMUBRK Ground SCIB+ SCIART S SCIARXD Reserved LCONT RAST LFRM LCLK LCD1 LCD3 Ground USER +5V D+ +5V SP IINT 0 CS1 CS3 MISO Ground SCLK +3.3V (I/O) AD[01] Ground AD[03] AD[05] +3.
Pins 1-5 on the DIMM socket control the Ethernet port on the NETdimmTM. Pins 6-8 control the InCircuit Emulator. Pins 9-13 control the UART port. Pins 14-20 control the LCD. Pins 21-22 control the USB port. Pins 23-29 control the SPI. Finally, pins 30-84 control the PCI bus. PCI The PCI interface on the dimmPCITM CPU module is constructed around a Cypress CY7C09449PV-AC bus controller.
has been extended to include ‘readb/readw/readl and writeb/writew/writel’ functions. The PCI BIOS also includes extensions to perform DMA transfers, and to manage the DPRAM. Drivers may request a transfer using shared DPRAM. Drivers for high bandwidth devices may request a private and permanent allocation of the DPRAM. The DMA mechanism allows the device driver to block or not until the requested transfer(s) have completed. The PCI BIOS uses interrupt driven code to manage the request queues.
This page left intentionally blank 32 www.amctechcorp.
3 uClinux Installation Installing the dimmPCITM System Builder Kit Before beginning This development kit requires an x86 compatible PC running some variant of linux. It will not work under any version of Windows. If linux is not installed on your computer, Redhat linux can be downloaded from http://www.redhat.com In addition root access is necessary for this entire process due to the fact that regular users do not have adequate permissions.
This will remove the development tools and their links. Note: any additional files that you may have added to the SDK directories will also be removed. Configuring and compiling the µClinux kernel NOTE: this step must be completed before creating an image file. The kernel source files are contained in the ‘/opt/uClinux/linux’ directory. From that directory the operation of the kernel can be customized. Base configuration files are available in the ‘/opt/ configs’ directory.
Creating a ROM image Before using the development hardware a file system will need to be created for use on it. The ‘/ opt/fs’ directory contains the tools necessary to create a filesystem image. From this directory run the Makefile. The first time you run this it will compile all the tools that will be used on the dimmPCI platform itself, subsequently it will create an image for download. make imagez.
inetd.conf inittab issue passwd rc resolv.conf services - this file contains information on which internet services the board will provide - determines which program will handle communication on the serial ports - the file that is displayed anytime someone tries to log onto the board - contains login/password information, this file is ignored by the current login program - this script is run right after kernel initialization, anything that runs at startup should be put in this file.
Accessing the Network The kernel supplied with the dimmPCITM CPU module supports TCP/IP networks (IPX is not supported at this time). Before the network may be accessed, the dimmPCITM CPU module must obtain an IP address. The subnets 10.xxx.xxx.xxx, 172.16.xxx.xxx, and 192.168.xxx.xxx are reserved for local area networks. Addresses are either statically assigned or dynamically allocated using DHCP (static IPs are still possible as the DHCP server allows specific MAC ID to IP mappings).
the typical 0.70 version of ‘dhcpcd’) which is executed when an IP is first obtained, or should the IP address change (the common operation is to execute every time an IP lease is renewed). The command is invoked with zero or more parameters. Often the command is ‘/bin/sh’, and the parameter is a script file. If the ‘-v’ option is specified, the IP address is written to ‘stdout’ as the command file is invoked.
cd ~/dimmpci mkdir source cd source Create a simple ‘hello world’ C program called ‘hello.c’ such as this: #include void main() { printf(“Hello World\n”); } Now run the GCC compiler to create the binary file. Links should be set up so the compiler is in the path. If not add ‘/opt/uClinux/bin’ to the path and everything should work fine. m68k-pic-coff-gcc hello.
/(home directory)/dimmpci/source (rw) Of course you will need to add the home directory. This will allow anyone read and write access to that portion of the file system. This is acceptable if on a private network, but highly undesirable if the computer is on the internet. See the man pages for the exports file if the NFS share needs to be secure.
Updating Applications on your dimmPCI module There are two methods for updating applications on the dimmPCI module: (1) create a new image file with the updated application, or (2) copy the updated application to the flash filesystem. Of course the latter option will be preferable in most situations since it is faster and easier. Method 1: The first step is to copy the new application file(s) to the somewhere in the ‘romdisk’ directory on the development computer.
This page left intentionally blank 42 www.amctechcorp.
4 Programming Mode Programming the uC68VZ328 There are two methods of reprogramming the flash of the dimmPCI. The first (and preferred) method uses a program named ‘loader’ run on the Dragonball VZ to read a flash image from a networked file system (usually an nfs share on the development platform).
5. All processes will be halted, and the programming will begin. The progress is shown by a ‘.’ displayed every 4kbytes. An ‘E’ indicates the erasure of a flash sector. When complete, verification will begin automatically. The dimmPCI will reboot automatically upon successful programming and verification. If errors are found, the address will be reported, and another attempt to reprogram the flash will begin (up to three attempts maximum). Notes: 1.
To use ‘oops’, the following steps must be followed: 1. Insert the jumper on EMU BREAK and reset the dimmPCI board. 2. Close any terminal software (minicom, etc.) that may be using the serial port (assumed to be /dev/ttyS0). 3. Invoke ‘oops’ cd /opt/boottools/oops ./oops -p /dev/ttyS0 -k kernel.bin 4. The software will set the speed on the dimmPCI to 115200bps, and begin transferring files, beginning with “init.b” and “loader.bin”. Next the “kernel.
3. The default kernel image file is ‘kernel.bin’ in the current working directory. The kernel.bin file is actually a symbolic link to a stable kernel image with a descriptive but lengthy file name. 4. By default, the flash programs erase the entire flash device, which will erase the contents of any complete, partial or corrupt ‘jffs’ filesystem. In some instances (e.g.
www.amctechcorp.
This page left intentionally blank 48 www.amctechcorp.
A Appendix Sample Code Included in the ‘/opt/samples/ directory are several files that show just some of the features available with the dimmPCI platform. The first sample application is a simple hello world program. Its sole purpose is to display a line of text that says “Hello World!” Basically it verifies that your compiler tools and development environment are functioning properly. // hello.
printf (“Cannot open file\n”); exit (-1); } // print the string to file fprintf (file_handle, “Hello World!\n”); // close the file afterwards fclose (file_handle); } This application shows how to open and configure the RS485 serial port for communication. It will write the same hello world string to the serial port and then close and exit gracefully. // serial.
} This program will read the date from the kernel clock and print it out to the standard output stream. // date.c // // This will read the date from the realtime clock and // display it on screen. #include #include #include void main() { struct timeval time_val; // read the date from the realtime clock gettimeofday(&time_val, NULL); // display the value from the clock printf(“%s”, ctime((time_t *) &time_val.
// convert it to seconds since 1970 time_val.tv_sec = mktime (&tm_val); // set the time in the linux system clock settimeofday (&time_val, NULL); // read the date from the realtime clock gettimeofday (&time_val, NULL); // display the value from the clock printf (“%s \n”, ctime ((time_t *) & time_val.tv_sec)); } This next program is an example of how to activate and manipulate the watchdog timer. // watchdog.
Finally, this source uses the inetd superserver to create a simple network server that will echo any characters received back to the client. This can be demonstrated by telnetting into the host board and typing some characters. // echo.c // // All this file does is echo any data written to its standard // input to it’s standard output. If run from the commandline it // will echo typed characters. If you add this line to your // /etc/inetd.
This page left intentionally blank 54 www.amctechcorp.
B Appendix The Journalling Flash File System There are two different types of memory available on the dimmPCI CPU module, SDRAM and flash memory. The SDRAM is virtually the same as the RAM in a personal computer; anything stored in this memory will be lost when the power is turned off. This is also referred to as volatile memory. The flash memory is analogous to the hard drive in your computer since it retains stored data even when the computer is turned off. This is called non-volatile memory.
A utility is included in the distribution that will erase all the data stored in the JFFS and reset its configuration. This may be useful if the filesystem becomes corrupted and needs to be reset. The program is ‘mkjffs’ and can be found in the ‘/sbin’ directory. In order to use this program, first unmount the JFFS and run ‘mkjffs’.
www.amctechcorp.
This page left intentionally blank 58 www.amctechcorp.
C Appendix Development Tool Chains A development tool chain is the suite of programs (including the compiler, linker, assembler, disassembler and library generation) used to develop for a specific executable format. This SDK installs three different tool chains: • The COFF tool chain. This tool chain is used to develop the uClinux kernel. There are no libraries associated with this tool chain. • The PIC-COFF tool chain. This tool chain is used to develop user applications.
Normal Usage of the PIC-COFF Tool Chain The PIC-COFF tool chain is normally very easy to use. The ‘Hello world’ program supplied in the samples directory is compiled as follows: m68k-pic-coff-gcc hello.c -o hello To compile the same program with the 32 bit extensions: m68k-pic-coff-gcc -fPIC hello.c -o hello Normal Usage of the ELF Tool Chain The ELF tool chain included with the SDK does not default to generate code for the Motorola M68VZ328, so additional command line arguments are needed.
www.amctechcorp.
This page left intentionally blank 62 www.amctechcorp.
D1 Application Note 1 Using Digital I/O with dimmPCI Modules July 4, 2003 Version 0.4 Author: Bernice Lau Introduction For the purposes of direct digital I/O, there are a maximum of 27 general-purpose I/O lines leading from the Motorola MC68VZ328 to the dimmPCI backplane. These lines also have dedicated functions, the LCD, EEPROM, SPI, or ICE_DEBUG, so all lines may not be available, depending on the hardware and the options compiled into the kernel.
Kernel and Filesystem Configuration The uClinux 2.0 kernel must have the digital I/O option compiled for proper operation. These options will be set using the kernel configuration cd /opt/uClinux/linux make menuconfig Using this main menu, under Character Devices the following must be selected Digital IO Character Device After saving your configuration changes, use the following commands in the same directory to complete compilation of your kernel.
Kernel and Filesystem Configuration Flow Chart At command Prompt cd /opt/uClinux/linux make menuconfig Main Menu Inside Menu Option Character Devices Digital IO Character device make dep make clean make Check if digital I/O character device exists: cd /opt/fs/romdisk/dev ls Does iolnode exist? No Please refer to NOTE A YES Generate new image: cd /opt/fs make clean make Run loader on the dimmPCI module using new image www.amctechcorp.
Available Digital I/O Pins The number of pins available for digital I/O depends on the other options compiled into the kernel. For example, if the EEPROM option is compiled in, then the bits from Port E bits[0-2] will not be available for digital I/O. During boot up, devices that require pins for their dedicated functions will reserve them, and thus these pins cannot be accessed by the digital I/O character driver.
Table 1: List of all available digital I/O pins Class Circuit N ame Port Bit Backplane System Slot LCD LCD0 Port C 0 A18 LCD1 Port C 1 B18 LCD2 Port C 2 A17 LCD3 Port C 3 B17 LFRM Port C 4 A15 LLP Port C 5 B15 LCLK Port C 6 A16 LADC Port C 7 B16 LCO N TRAST Port F 0 A14 EE MO SI Port E 0 B13 EE MISO Port E 1 B14 EE CLK Port E 2 A13 SPI nIN T0 Port D 5 A24 SPI nIN T1 Port D 6 B23 SPI MO SI Port J 0 B28 SPI MISO Port J 1 A27 SPI CLK Port
Programming Structure The structure that should be used to store pin configuration and information is dimm_io from dimmio.h, located in /opt/uClinux/linux/include/linux/. Table 2 below describes the six fields of the structure and their settings.
Digital I/O Functions The low level functions used to manipulate the digital I/O points are the system calls open, lseek, read, write, close, and ioctl. The uses of these functions are demonstrated in two simple sample programs, xor.c and even_parity.c. open gives access to the digital I/O character device. It takes two parameters, the node for your device in / dev and the mode you wish to open it in. For the digital I/O device, you will want to use the node /dev/io1 and the mode for read and write O_RDWR.
DIMM_IO_IOCTL_MAP will return an offset given a port and bit number. The bit and port number must be assigned to port_number and bit_number in the dimm_io structure that is passed to the ioctl command. The offset will be assigned to the offset field of the structure if the port and bit number exists in the list of active I/O points, otherwise an error is returned. DIMM_IO_IOCTL_RETRIEVE returns a port and bit number given an offset.
Sample Programs Each of the sample programs even_parity.c and xor.c demonstrate simple use of digital I/O. The source code for these files is available in the samples directory of the SDK, /opt/samples. xor.c performs the XOR logic function on 3 inputs. The XOR is performed on the first two inputs and the result output to the first output. The result of the second and third input XOR are sent to the second output. even_parity.
NOTE A: Creating a node for the character device Since the node for the digital I/O device does not exist in the /opt/fs/romdisk/dev directory, it needs to be created. Create the node by doing the following as root, where 123 is the major number and 1 the minor number of the character device io1. mknod io1 c 123 1 After the correct node is created, then continue with compiling the kernel and filesystem image.
www.amctechcorp.
This page left intentionally blank 74 www.amctechcorp.
D2 Application Note 2 Configuring dimmPCI Modules for Communication April 21, 2003 Version 0.1 Authors: Bernice Lau, Robert Austen Abstract On a dimmPCI backplane, there are several possible slots in which a dimmPCI may be inserted, the system slot or the peripheral slots. With the correct options compiled into the kernel and system configuration, the two modules can be set up to communicate with each other.
On the NETdimm in the system slot, the ethernet port, eth0, must be configured to have an IP address on the local network for your host computer. Therefore eth0 acts as a gateway into the dimmPCI subnet for the local area network. It is also the outside interface for your subnet to the local area network. On the system slot NETdimm, the pci0 device is the inside interface to a second or third dimmPCI module in a peripheral slot. This device will be the gateway used by each peripheral dimmPCI module.
From the main menu, inside of Networking Options this option must be set: IP forwarding/gatewaying Again, from the main menu under Network device support: Network device support NE2000/NE1000 ISA ethernet After saving your configuration changes, use the following commands in the same directory to complete compilation of your kernel. make clean make dep make www.amctechcorp.
Kernel Configuration Flow Chart At Command Prompt cd /opt/uClinux/linux make menuconfig Main Menu Option General Setup PCI support PCI I2O transport layer PCI networking support Networking Options IP forwarding/gatewaying Networking device support make clean make dep make 78 Options to Select www.amctechcorp.
Filesystem Configuration For the dimmPCI units to be correctly configured for the subnet, the rc file must be modified. These different configurations should each be contained in a separate copy of the filesystem, since different applications will be used. Copies of the filesystem can be generated in the following way. Here we will assume that the original filesystem is /opt/newfs, and the new filesystems, sysfs is for the system slot and perfs for the peripheral slot.
specified since pci0 will be the network interface. The gateway value must correspond to the IP address of the system slot pci0, 192.168.7.1. Thus, different rc files must be configured for each copy of the filesystem, generating a different image to be loaded for each module. Note that the eth0 and pci0 can be configured manually by typing in the specific information at the command prompt on the dimmPCI module, but changes will not be retained upon reboot.
Filesystem Configuration Flow Chart Modifications to ‘rc’ file At Command Prompt Copy filesystem cd /opt/ cp –Rpdx newfs sysfs cp –Rpdx newfs perfs System Slot NETdimm Configuration comment out ‘dhcp’ client line (if applicable) add static ip code for eth0 and pci0 save changes & exit cd /opt/sysfs/romdisk/etc/ vi rc Generate new system slot image: cd /opt/sysfs/ make clean make Run loader on the NETdimm using the new image Peripheral Slot dimmPCI module Configuration cd /opt/perfs/romdisk/etc/ vi rc
Host machine Configuration After configuring the two dimmPCI modules, they can now communicate with each other, as well as the outside network. But the outside network cannot access the dimmPCI subnet. Therefore a route to the subnet must be added to redirect packets to the proper device. The most convenient method is to add the route to the gateway for the local network, in this example it is 192.168.10.1.
www.amctechcorp.
This page left intentionally blank 84 www.amctechcorp.
D3 Application Note 4 Using Multiple NETdimm Modules Author: Bernice Lau Version 0.1 Abstract On a dimmPCI backplane, there are several possible slots in which a dimmPCI may be inserted, the system slot or the peripheral slots. Once configuration has been completed, the NETdimm modules can successfully communicate with each other. This application note describes the use of the PCI bus sending ethernet packets to transfer a file between two NETdimm devices.
Simple Server & Client The sample programs server.c and client.c are available in the SDK samples directory, /opt/user_code/networking/filetransfer/without_inetd. The programs interact using Internet sockets, AF_INET. Once the sockets have been established they can be read from and written to in order to transfer information. Each program will be run on a separate NETdimm, and using the IP addresses established during configuration, text files such as hello.txt can be transferred between them.
inetd.conf. Upon receiving a connection request, it will start up the server. Therefore the server has no need to set up sockets. The inetClient is very similar to the simple client, since it must still read and write to a socket. The socket is set up using information gathered by the function getservbyname() which will check for the service inetServer on the host NETdimm. After confirmation of the service is established, the program will create a socket, connect and transfer the file as before.
This page left intentionally blank 88 www.amctechcorp.
D4 Application Note 5 Using Analog and Digital I/O with the IOdimm June 30, 2003 Version 0.1 Author: Bernice Lau Introduction The IOdimm is designed to support dedicated analog and digital I/O. There are 8 analog inputs, 2 analog outputs, 8 digital inputs and 4 digital outputs. All of these I/O channels are accessible from the dimmPCI backplane. User-space programs interact with the I/O channels through a device driver using standard system calls.
After saving your configuration changes, use the following commands in the same directory to complete compilation of your kernel. make clean make dep make Next make a copy of the filesystem, specifically for the IOdimm cd /opt/ cp –Rpdx newfs iodimmmfs Then create a combined image of the new kernel and filesystem. cd /opt/iodimmfs make clean make Finally use imagez.bin and run loader on the IOdimm to write in the filesystem and kernel. Please refer to the User’s Manual for details on running loader.
Kernel and Filesystem Configuration Flow Chart At Command Prompt Main Menu Inside Menu Option cd /opt/uClinux/linux make menuconfig Platform dependent support SPI support for IOdimm ADC MAX1203 make dep make clean make Make a copy of the filesystem: cd /opt/ cp –Rpdx newfs iodimmfs Generate new image: cd /opt/iodimmfs/ make clean make Run loader on the IOdimm using the new image www.amctechcorp.
Available I/O Pins The IOdimm has 8 analog inputs, 2 analog outputs, 8 digital inputs, and 4 digital outputs available for use. Note that only the analog I/O channels lead to headers on the backplane. Any digital I/O channels must be accessed by soldering wires to the peripheral slot where the IOdimm is inserted.
I/O Functions The low level functions used to manipulate the I/O channels are the system calls open, lseek, read, write, close, and ioctl. The I/O channels are accessed through 3 character drivers for the digital I/O, ADC, and DAC. The uses of these functions are demonstrated in the sample programs fir.c, xor_iodimm.c, and even_parity_iodimm.c.
As shipped, each ADC channel has a divide by 4 attenuator stage and a multiply by 2 amplifier stage. Thus for a signal applied to analog input pins on the backplane, a count of 4095 will correspond to a voltage of 8.192V. For the DAC, analog output 0 has a multiply by 2 gain stage, so a count of 4095 corresponds to a voltage of 8.192V. Analog output 1 has a 4-20 current output circuit, with a count of 0 corresponding to approximately 3.5mA and 4095 corresponding to about 25mA.
The sample FIR is a quick and dirty low pass filter with linear phase. The design parameters of the filter are a –3dB cutoff at Ωc = 30π rad/sec, ωc = 0.3π rad and an attenuation of 50dB at Ωr = 45π rad/sec, ωr = 0.45π rad. For example, a sampling rate of 64000 samples/second (T-1 = 64000 samples/s), yields a analog frequency cutoff of 9.6kHz and the 50dB attenuation corner point at 14.4kHz. xor_iodimm.c performs the XOR logic function on 3 inputs.
even_parity_iodimm.c is a program that will do even parity on 8 input pins, and the result is sent to 1 output pin. Thus, if there is an even number of ‘1’ inputs, then the output will be ‘0’. Conversely, if there is an odd number of ‘1’ inputs, the output will be ‘1’. The source code for xor_iodimm.c is available in /opt/ samples/card_specific/iodimm/dio. in0 in1 in2 in3 in4 in5 Even Parity 96 www.amctechcorp.
www.amctechcorp.
This page left intentionally blank 98 www.amctechcorp.
D5 Oops Documentation Using Oops June 11, 2003 Version 0.1 Authors: Bernice Lau, Robert Austen Introduction oops is a program to upload/download to a M68K family processor using EMU mode. The executable must be compiled for the first time using gcc on the development platform. There is a Makefile included in /opt/boottools/oops/src Prior to running ‘oops’ the jumper must be inserted on EMU BREAK and the dimmPCI board reset. Any terminal software (minicom, etc.
kernel.bin is a binary file containing the image of the compiled dimmPCI kernel, and it is the default kernel file. kernel.bin is in the current working directory, but it is a symbolic link to a stable kernel image with a descriptive but lengthy file name. image.bin is a binary file set as the default download program file, which will make an image of an area of the Dragonball memory, most likely flash. memory.bin is a binary file to download an image of the memory.
Erasing the flash with the -em option allows for the journaling flash file system (jffs) to be preserved when you wish to load a new image consisting of the kernel and root filesystem. ———————————————————— | kernel | rootfilesystem | | jffs | ———————————————————— <—— replaced ——> <—saved—> After the image has been written to flash, the system will reset.
To download using the default download program, image.bin: -d This will download an image from the flash. To specify the download program: -dp Two binaries have been provided for this purpose, image.bin and memory.bin. image.bin as mentioned above is the default, while memory.bin will download an image of the memory. The start and length of the image desired for download can be specified: -dr eg.
Appendix The following is the format of the init.b file: aaaaaaaaccdd’\n\r’ where aaaaaaaa address cc count (cannot be equal to 0) dd number of bytes eg. cc=2, there must be dddd = 2 dd ‘\n\r’ each line is followed by a carriage return and/or line feed WAIT # ——— causes a wait for ms comment www.amctechcorp.
This page left intentionally blank 104 www.amctechcorp.
E Appendix Licensing, Copyrights & Liability dimmPCITM Software Development Kit Distribution The different parts of the distribution are licensed under various OpenSource License agreements. Ensure that you examine the code in question for the appropriateness of its license to a given applications. Some of the licenses used are reproduced in this section for your reference. GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2.
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machinereadable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients’ exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7.
following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission.
each source file to most effectively convey the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
grams. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
www.amctechcorp.
This page left intentionally blank 114 www.amctechcorp.
F Appendix References/ Suggested Reading 1998 O’Reilly. Linux Device Drivers. Alessandro Rubini. 2001 O’Reilly. Understanding the Linux Kernel. Daniel P. Bovet & Marco Cesati. www.amctechcorp.