Documente Academic
Documente Profesional
Documente Cultură
DSKcam
Users manual
Version 3.1
Revision history 4
Introduction...............................................................................5
Features ................................................................................5
Applications ............................................................................6
Requirements ..........................................................................7
Compatibility ........................................................................... 13
Support .................................................................................. 13
Camera .................................................................................. 14
Frame grabber.......................................................................... 14
Software ................................................................................. 20
Frame grabbing...................................................................... 21
DSKcam API........................................................................... 23
W3100A API........................................................................... 24
Revision history
Version Comment
Introduction
Care has been taken during the development of DSKcam to ensure end users can
start using their system with minimal effort. This manual describes the
functionality of the DSKcam and introduces the sample software shipped with
the unit.
Features
The DSKcam provides users with a complete, Smart Camera system bringing
together real-time, high performance DSP with image capture capabilities. Also,
by employing the integrated digital and analogue I/O included on the DSKs,
stand-alone PLC type systems can be developed and prototyped. The DSKcam
provides the following features,
Raw RGB and YUV422 digital image output at VGA and QVGA resolution
UART compatible with TI, IOM mini driver for PIP and SIO support.
Applications
Real-time video image processing is becoming more and more popular and
constantly finding new, exciting applications. Typical applications for a DSKcam
system are,
Machine vision
Video phone
Surveillance systems
Video streaming
VOIP projects
A block diagram of the DSKcam is shown in Figure 1. The camera, frame buffer ,
serial port, Ethernet adaptor and CPLD are the subject of the remainder of this
manual.
Frame Grabber
Wi-FI*
BUFFER Y
D[8..15]
FIFO Y
TCP/IP
CTRL
RJ45
BUFFER UV
FIFO UV
D[0..7]
UART
CTRL
RS232
CPLD
CTRL
CTRL
DSK Interface
Requirements
The DSKcam requires a full installation of the CCS version 2.21 or above. It is also
necessary to install the Device Drivers Development Kit (DDK) that can be
downloaded from the TI Website. The DDK package contains the necessary base
routines for the UART mini-driver. The TI Image Library is required to run the
sample video streaming application which can also be downloaded from the TI
website. For the sample host application, (Video For Windows) VFW or
compatible is required if a re-build is necessary. This can be downloaded from
the Microsoft Website. All other software and documentation is shipped with the
DSKcam.
Hardware Installation
The DSKcam is based on two separate PCBs. The main daughter card interfaces
directly onto DSK and the camera head inserts into the 32-way header. The
daughter card connectors are polarity sensitive preventing incorrect insertion.
The second card, the camera head, must be inserted into the 32-way header on
the daughter card taking care of orientation. The correct insertion is shown in
Figure 2 and Figure 3 below. There is the option of including a 90-degrees
adaptor giving more flexibility in the orientation of the installed system see
Figure 2 and Figure 3 below.
Also, the camera module may be connected via a ribbon cable. As the camera
signals may run at 13Mhz, it is recommended that the ribbon cable length be
kept to a minimum.
Camera
head
90 degree
adaptor
Serial port
DSKcam
daughter
card
TI DSK
motherboard
Figure 5 shows the DSKcam in more detail. The differences for units fitted for Wi-
Fi operation is indicated.
W 3100A W-LINK
TCP/IP Active
Eternet LED*
Camera
interfa ce
port
www.BiTEC.Ltd.uk
DSKcam v3.0
D-TYPE
Ethernet
RJ-45 ** Composite
out
(PAL)
W ireless
module*
Ethernet W ireless
CPLD JTAG
indicator factory
CPLD Port
LEDs reset*
Figure 5 Board detail. * Fitted on Wireless LAN option. ** Fitted on Ethernet option.
Software Installation
The CD ROM shipped with the DSKcam contains a sample video streaming
application to demonstrate the capture and processing of images. The contents
of the CD ROM should be copied into the c:\ti\myprojects folder within the CCS
directory structure. The streaming application can be opened in the CCS IDE and
compiled and downloaded to a target DSK with the DSKcam correctly inserted.
The project build options assume the CCS is installed in C:\ti with the DDK
installed in c:\ti\ddk. Any non-standard installation will require changes to the
include files and library file locations in the project build options.
Example Software
used by the Ethernet adaptor should conflicts occur. The same host application
as with the serial interface is used with command line invocation …
The web server can generate dynamic pages. A special tag in, <DATA myvar>,
inserted in the raw html is intercepted by the web server. In order to respond to
the myvar variable the routine addDynamicContent("myvar",
&myvarfunc); must be executed to associate the variable with the function
myvarfunc. An example of this is included in the webserver.
A sample webpage is provided which outputs a jpeg image from the camera. The
jpeg routine is not optimised and is for demonstration purposes only. When the
application is running, the page can be accessed using the link.
http://192.168.11.33/index.html This assumes the default IP address is used.
Basic example
A basic skeleton routine is provided with the DSKcam. This routine is designed as
a basis for developing a video processing application. All the necessary
commands for initialisation of the UART, camera and TCP interface are provided.
The user may run the example and then break execution to see the captured
image. Viewing the image can be done using the CCS graph viewing feature.
Details of how to do this are given in the file main.c
UART example
Use of the UART is demonstrated using the UART example. As the UART is
accessed using the TI, IOM mini driver the example is taken from the TI DDK
package. Please refer to the documentation in the DDK installation.
Compatibility
The DSKcam has been designed to run on the C6416DSK, C6711DSK, C6211DSK,
C6713DSK, C5510DSK and C5416DSK. Minor code changes may be necessary
according to which DSP family is used due to differences in the underlying
architecture. The DSKcam is also compatible with the ALTERA Startix II DSP
Development System. See www.altera.com for more details.
Support
Support for hardware and software issues relating to the DSKcam can be directed
to support@BiTEC.Ltd.uk. Other DSKcam users may gain from any comments and
suggestions on the USENET groups. Relevant groups for DSKcam are
news://comp.dsp and news://sci.image.processing. Software and documentation
updates are posted on http://www.BiTEC.Ltd.uk.
Camera
The camera used in the DSKcam is based on the Omnivision OV7620 CMOS sensor.
With 124 registers, a full description of the device is beyond the scope of this
manual. The reader is referred to the OV7620 datasheet available on the
Omnivision website and may also be found on the DSKcam CDROM. Example
software is provided showing a typical programming arrangement ideal for
getting started. As the OV7620 has enjoyed a great popularity with OEM
manufactures, there is a wealth of information and programming tips on the
Internet. For more insight in to possible programming, the reader is referred to
the Linux, webcam community and in particular the OV511+, Linux driver
sources.
Access to the camera registers is via a serial i2c interface. Rather than installing
an i2c interface on the DSKcam, the functionality of i2c is implemented by ‘bit-
banging’ fields in the I2C, CPLD register (see below). As frequent programming
of the camera is not necessary, a bit-banging approach is more than adequate for
the DSKcam. Routines are provided on the CDROM for reading and writing to the
i2c interface.
Frame grabber
The frame buffer is based around two, Averlogic AL422 FIFOs. The FIFOs are big
enough to hold a complete colour VGA frame. The hardware interfacing the
camera to the FIFO allows continuous update of frames without DSP intervention.
As discussed later, there is a HOLD signal which the DSP can activate to prevent
the FIFO from being updated when necessary. Reseting of the FIFO read address
pointer is accomplished by writing to the FIFO port.
FIFO CPLD
An ALTERA CPLD controls the DSKcam FIFO and chip select logic. This device is
used to generate the correct access signals for the FIFO while satisfying the DSP
External Interface requirements. The CPLD contains four, four-bit registers
appearing in D0-D3 of the databus. These are described below.
0xA0018000 Interrupt Control Reg (ICR) Used for the ALTERA DSK
0xA0030000 Unused
The ICR is necessary for compatibility with the ALTERA FPGA development kit. It
allows the DSKcam to multiplex the individual interrupt sources onto the single
External Interrupt 4 DSP signal. This is required as the ALTERA DSK only contains
one interrupt signal on the expansion connector.
This register is used to generate the I2C signals necessary for the camera control.
D0 (I2CDATA) R/W This signal drives and reads the I2C data line
D2 (Unused) -
D3 (Unused) -
This register is used to control and read the necessary FIFO control signals. It is
used to hold and synchronise the FIFO read and write pointers appropriately.
Reading this register will de-activate a pending FIFO interrupt.
D3 (Unused) -
When read, this register yields a four bit number corresponding to the CPLD
version.
1
On the C64x, the daughter card asynchronous interface is controlled by EMIFA.
• IP Address: 192.168.11.30
• Subnet mask:192.128.11.1
• Gateway: 255.255.255.0
• User: admin
• Password: admin
These settings, including the IP address can then be changed. Details on how to
configure the NM6000 module can be found in the data sheet on the DSKcam CD
ROM.
The factory defaults for the wireless interface can be reset using the button on
the DSKcam board.
The 9-way d-type connector pinout is shown in the table below for both RS232
and RS485 options.
PIN RS232
2 Tx
3 Rx
5 GND
7 CTS
8 RTS
Software
Example applications are shipped with the DSKcam to enable users to grab,
process and review images. The application grabs an image under interrupt
control and then compresses the image into an h263 bit stream. This bit stream is
then transferred to the host PC via the serial port or TCP interface. The h263
compression only performs intra compression and does no motion compensation.
With the serial port running at 115kBits/sec, a frame rate of approximately 1 per
second is achievable.
A host application is included in the package. Based on the Telenor h263 codec,
the application has the option to read the bit-stream from the serial port rather
then just a file. When reading from the port, the bit-stream is also saved to a file
on disk.
The example requires the TI C6x image-processing library and may require minor
adjustments to the build options before compilation depending on how the base
CCS package is installed.
Frame grabbing
Capturing images from the DSKcam is simple and, when correctly implemented,
requires little DSP processing. The sample streaming application uses a hardware
interrupt routine, EDMA channel and DSP/BIOS semaphore. See the DSKcam API
below.
At start-up the three frame buffers A, B and C are as in Case 1. The DSP
processes the image in buffer A while the DSKcam interrupt routine stores frames
in buffers B and C in a circular manner. When the main application requests a
new frame the contents of buffer B is used and the interrupt routine now stores
new frames in buffers A and B. This process continues in Case 3 where the main
application processes from buffer C and the interrupt routine updates Buffers A
and B. This technique is easily achieved by using pointer updates. To prevent the
main application blocking out other tasks when waiting for a new frame, a
DSP/BIOS semaphore is used as communication between the interrupt routine
and the main application.
Occasionally, the DSP may cause and overrun on the FIFO transfer progress. This
is accommodated within the API by re-synchronising the FIFO pointers
appropriately. It should be noted that when re-synchronising, frames would be
lost.
DSKcam API
Three functions form the DSKcam API. These functions are detailed below
struct DSKcam_params {
int segid; /* Default 0 */
enum { VGA, QVGA} frame_size; /* Default QVGA */
ovcamchip_regvals camregvals[]; /* Default NULL */
} DSKcam_params;
The segid parameter defines the memory segment used in MEM_alloc for the
triple buffer. This memory region must be large enough for the buffer to be held.
The frame_size parameter determines the image used grabbed from the
camera. Finally, the user may which to include extra register or over-write the
default register programming used in the camera by including a list or
register/value pairs. The format of the camregvals is shown below,
#define DSKcam_ERR_NONE 0
#define DSKcam_ERR_MALLOC 1
#define DSKcam_ERR_FSIZE 2
#define DSKcam_ERR_CAMERR 3
#define DSKcam_ERR_SEMERR 4
#define DSKcam_ERR_EDMABUSY 5
#define DSKcam_ERR_OPEN 6
W3100A API
The DSKcam software includes a simple API to access the W3100A functions. The
API follows the Berkley socket style of TCP programming. Below is a description
of the various functions in TCP stack level.
void initW3100A(void)
Arguments None
Return value None
Description W3100A initialization function for S/W resetting of the W3100A. Sets the initial SEQ# to be
used for TCP communication.
Description W3100A initialization function. Can also be called to change network settings.
void setbroadcast(SOCKET s)
Arguments s: Channel number
char NBlisten(SOCKET s)
Arguments s: Channel number
Return value 1
Description Waits for connection with a peer. (Non-blocking Mode) in TCP server mode.
void initseqnum(SOCKET s)
Arguments s: Channel number
Description UDP data receiving function. Function for receiving UDP and IP layer RAW mode data, and
handling the data header.
char close(SOCKET s)
Arguments s: Channel number
Return value 1
Description Channel closing function.
Return value Socket status or free transmit buffer size or received data size
Description Function handling the channel socket information.
char W3100A_mem_check(void)
Arguments s: Channel number
Appendix C: Schematics
+5V RESET#
U8 U7A
UV0 1 28 DUV0 U2A 74HCT74
UV1 2 DI0 DO0 27 DUV1 74HCT00
4
UV2 3 DI1 DO1 26 DUV2
UV3 4 DI2 DO2 25 DUV3 2 5 2 HOLD
PR
5 DI3 DO3 24 3 Q D
6 WE RE 23 1 3
7 GND GND 22 CLK EXT_INT5
8 TST OE 21 RRST 6
CL
9 WRST RRST 20 YUV# Q +5V
10 WCK RCK 19 +5V
1
UV4 11 VDD DEC/VDD 18 DUV4
UV5 12 DI4 DO4 17 DUV5
UV6 13 DI5 DO5 16 DUV6
DI6 DO6 U7B
UV7 14 15 DUV7
13
DI7 DO7
74HCT74
8
CL
AL422B + Q
C12 RESET 11
2.2UF +5V J1 CLK
4 +5V +5V 9 12
PR
1 SIG Q D
DUV[7..0] 2 GND
10
3 GND R4 R5
GND 10K 10K
+5V PHONO
U9
U4 32 31
Y0 1 28 DY0 UV7 30 VTO GND 29 UV6
Y1 2 DI0 DO0 27 DY1 UV5 28 UV7 UV6 27 UV4
Y2 3 DI1 DO1 26 DY2 UV3 26 UV5 UV4 25 UV2
Y3 4 DI2 DO2 25 DY3 UV1 24 UV3 UV2 23 UV0
5 DI3 DO3 24 22 UV1 UV0 21
6 WE RE 23 20 VCC AGND 19
7 GND GND 22 18 VCC EXCLK 17
8 TST OE 21 16 PCLK AGND 15
9 WRST RRST 20 YUV# 14 VSYN AGND 13 FSR1
10 WCK RCK 19 12 HREF SCL 11 DR1
Y4 11 VDD DEC/VDD 18 DY4 10 FODD SDA 9 R2 DX1
Y5 12 DI4 DO4 17 DY5 Y7 8 RST PWDN 7 1K Y6
Y6 13 DI5 DO5 16 DY6 Y5 6 Y7 Y6 5 Y4
Y7 14 DI6 DO6 15 DY7 Y3 4 Y5 Y4 3 Y2
DI7 DO7 Y1 2 Y3 Y2 1 Y0
Y1 Y0
AL422B +
C3 OV7620
2.2UF
UV[7..0]
Y[7..0]
+5V
DY[7..0]
C7 C14 C1
0.1UF 0.1UF 0.1UF
A[21..2]
+5V +5V
+5V +5V
PERI1
MEM1
1 2
1 2 3 12V -12V 4
A21 3 5V 5V 4 A20 5 GND GND 6
A19 5 XA21 XA20 6 A18 7 5V 5V 8
A17 7 XA19 XA18 8 A16 9 GND GND 10
A15 9 XA17 XA16 10 A14 11 5V 5V 12
11 XA15 XA14 12 13 SPARE(N/C) SPARE (N/C) 14
A13 13 GND GND 14 A12 15 RSVD(N/C) RSVD (N/C) 16
A11 15 XA13 XA12 16 A10 17 RSVD(N/C) RSVD (N/D) 18
A9 17 XA11 XA10 18 A8 19 SPARE(N/C) SPARE (N/C) 20
A7 19 XA9 XA8 20 A6 21 3.3V 3.3V 22
21 XA7 XA6 22 23 CLKX0 N/C 24
A5 23 5V 5V 24 A4 25 FSX0 DX0 26
A3 25 XA5 XA4 26 A2 27 GND GND 28
27 XA3 XA2 28 29 CLKR0 SPARE (N/C) 30
29 /XBE3 /XBE2 30 31 FSR0 DR0 32
31 /XBE1 /XBE0 32 33 GND GND 34
33 GND GND 34 35 CLKX1 N/C 36
35 XD31 XD30 36 37 FSX1 DX1 38 DX1
37 XD29 XD28 38 39 GND GND 40
39 XD27 XD26 40 41 CLKR1 SPARE (N/C) 42
XD25 XD24 FSR1 DR1 DR1
3.3V 41 42 FSR1 43 44
3.3V 3.3V 3.3V GND GND
43 44 45 46
45 XD23 XD22 46 47 TOUT0 TINP0 48
47 XD21 XD20 48 49 SPARE(N/C) EXT_INT5 50 EXT_INT5
49 XD19 XD18 50 51 TOUT1 TINP1 52
51 XD17 XD16 52 53 GND GND 54
D15 53 GND GND 54 D14 EXT_INT4 55 XEXT_INT4 N/C 56
D13 55 XD15 XD14 56 D12 57 N/C N/C 58
D11 57 XD13 XD12 58 D10 59 N/C N/C 60
D9 59 XD11 XD10 60 D8 RESET# 61 /XRESET N/C 62
61 XD9 XD8 62 63 GND GND 64
D7 GND GND D6 RRST XCTRL1 XCTRL0 HOLD
63 64 65 66
D5 65 XD7 XD6 66 D4 67 XSTAT1 XSTAT0 68
D3 XD5 XD4 D2 EXT_INT6 EXT_INT6 EXT_INT7
67 68 CE3# 69 70
D1 69 XD3 XD2 70 D0 71 N/C N/C 72
71 XD1 XD0 72 73 N/C N/C 74
73 GND GND 74 75 N/C N/C 76
RE# /XRE /XWE WE# GND GND
75 76 77 78
OE# /XOE XRDY GND XCLKOUT2
CE3# 77 78 CE2# 79 80
79 /CE3 /CE2 80 GND GND
GND GND TI6000 DBRD MEMORY 40X2
TI6000 DBRD EXPANSION 40X2
D[15..0]
+5V
DUV[7..0]
U12
DUV0 2 18 D8 C8
DUV1 3 A1 Y1 17 D9 0.1UF
DUV2 4 A2 Y2 16 D10
DUV3 5 A3 Y3 15 D11
DUV4 6 A4 Y4 14 D12
DUV5 7 A5 Y5 13 D13
DUV6 8 A6 Y6 12 D14
DUV7 9 A7 Y7 11 D15
A8 Y8
OE# 1
19 G1
CE2# G2
74HCT541
DY[7..0]
U3
DY0 2 18 D0
DY1 3 A1 Y1 17 D1
DY2 4 A2 Y2 16 D2
DY3 5 A3 Y3 15 D3
DY4 6 A4 Y4 14 D4
DY5 7 A5 Y5 13 D5
DY6 8 A6 Y6 12 D6
DY7 9 A7 Y7 11 D7
A8 Y8
OE# 1
19 G1
CE2# G2
74HCT541
D[15..0]
U11B
4
CE2#
6
5 YUV#
RE#
74HCT32
D[15..0]
+5V
U8
10 1 D0
SDI D0 2 D1
DSP_WE# 18 D1 3 D2
WR1 D2 P1
19 4 D3
DSP_RE# 21 WR2 D3 5 D4 RS232
22 RD1 D4 6 D5
25 RD2 D5 7 D6
35 ADS D6 8 D7 C14
CPLD_RESET MR D7
36 0.1uF
5
9
4
8
3
7
2
6
1
37 CTS 11 +5V
38 DSR SDO
39 DCD 34 C13
RI OUT1 31 0.1uF
OUT2
3
16
9 XIN 23
C1-
C+
RCLK DDIS 24 2
TXRDY UART_INT# V+
R7 Y1 A2 28 29
1M 16.0Mhz A3 27 A0 RXRDY 30 11 14
A1 INTRPT EXT_INT6 T1IN T1OUT
A4 26 32 10 7
A2 RTS 33 12 T2IN T2OUT 13
12 DTR 9 R1OUT R1IN 8
13 CS0 17 R2OUT R2IN
14 CS1 XOUT 15 6
CS_UART# CS2 BAUDOUT V-
C2+
C2-
C9 C11 C16
15pF 50pF TL16C550A 0.1uF U10
5
MAX232A/SO
C15
0.1uF
A[4..2]
+5V
C6
0.1uF
+5V
R5
200R
U6
U1 1
DSP_EXT_INT5 +5V
3.3V 1 25 2
2 3.3V GND 26 +5V
ETH_INT# INT RESET DSP_RESET# 3.3V
DSP_WE# 3 27 7
4 WR TPTX+ 28 RXO+
DSP_RE# RD GND
A[21..2] CS_ETHER# 5 29 8
6 CS TPTX- 30 RXO-
CPLD_RESET 200R
A16 7 RESET L_COL 31 COL R12 5
8 A14 GND 32 Wireless Linc/ACT
200R
A14 9 GND L_100ACT 33 100ACT R13 6
A15 10 A12 TPRX+ 34 Factory Reset
200R
A12 11 A13 L_10ACT 35 10ACT R14 3
A13 12 A10 TPRX- 36 TXO+
200R
13 A11 L_LINK 37 LINK R15 4
A11 14 GND GND 38 TXO-
A10 15 A9 GND 39 D1 9
A9 16 A8 D1 40 D0 GND
A8 17 A7 D0 41 D3 10
A6 D3 GND
1
A7 18 42 D2 W-LINK
A6 19 A5 D2 43 D5 S1
A4 D5 NM6000A
A5 20 44 D4
A4 21 A3 D4 45 D7
A3 22 A2 D7 46 D6
2
A2 23 A1 D6 47
FACTORY RESET
24 A0 GND 48
GND 3.3V 3.3V
IIM7000A
R1
U3
D[15..0] 200R
1
TD+
2
TD-
3
TCT
4
NC
5
NC
6
RCT
7
RD+
8
RD-
9 3.3V
GND 10
MAG GND
R4
0R
C7 C4
0.1uF 0.1uF
BiTEC Ltd All information and data contained in this data sheet are
12 The Close, Leamington Spa without any commitment, are not to be considered as an
Warwickshire, CV31 2BL offer for conclusion of a contract, nor shall they be construed
as to create any liability. Any new issue of this data sheet
United Kingdom
invalidates previous issues. Product availability and delivery
Tel. +44-(0) 797-964-5514 are exclusively subject to our respective order confirmation
Fax +44-(0) 871-661-0229 form; the same applies to orders based on development
E-mail: info@BiTEC.Ltd.uk samples delivered. By this publication, BiTEC Ltd does not
Internet: www.BiTEC.Ltd.uk assume responsibility for patent infringements or other rights
of third parties, which may result from its use.