ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 4199

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Servo Entry

The default serial interface for the radio transfer

Valid values are SERIAL1, SERIAL2, SERIAL3

short serspeed:

The default baudrate for the selected serial interface.

Valid values are SER9600, SER19200, SER38400, SER57600, SER115200

short imagemode:

The mode in which the images of the camera should be transferred to the PC. Valid values are IMAGE_OFF (no image), IMAGE_REDUCED (reduced quality), IMAGE_FULL (original frame)

short protocol:

This specifies the module type connected to the serial port.

Valid values are RADIO_METRIX (message length 50 Bytes), RADIO_BLUETOOTH (mes.len. 64KB), RADIO_WLAN (message lenngth 64KB)

C.13 Servo Entry

typedef struct

{

int

driver_version;

int

tpu_channel;

int

tpu_timer;

int

pwm_period;

int

pwm_start;

int

pwm_stop;

}servo_type;

e.g.

servo_type servo0 = {1, 0, TIMER2, 20000, 700, 1700};

int driver_version:

The maximum driver version for which this entry is compatible.

Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.

int tpu_channel:

The tpu channel the servo is attached to. Valid values are 0..15

Each servo needs a pwm (pulse width modulated) signal to turn into different positions.

The internal TPU of the MC68332 is capable of generating this signal on up to 16 channels. The value to be entered here is given through the actual hardware design.

int tpu_timer:

The tpu timer that has to be used. Valid values are TIMER1, TIMER2

The tpu generates the pwm signal on an internal timer basis. There are two different timers that can be used to determine the actual period for the pwm signal.

TIMER1 runs at a speed of 4MHz up to 8MHz depending on the actual CPU-clock which allows periods between 128Hz and 4MHz (with 4MHz basefrq) up to 256Hz - 8MHz (with 8MHz)

TIMER2 runs at a speed of 512kHz up to 1MHz depending on the actual CPU-clock which allows periods between 16Hz and 512kHz (512kHz base) up to 32Hz - 1MHz (1MHz base)

To determine the actual TIMERx speed use the following equation: TIMER1[MHz] = 4MHZ * (16MHz + (CPUclock[MHz] % 16))/16 TIMER2[MHz] = 512kHZ * (16MHz + (CPUclock[MHz] % 16))/16

int pwm_period:

This value sets the length of one pwm period in microseconds (us).

425


C Hardware Description Table

A normal servo needs a pwm_period of 20ms which equals 20000us. For any exotic servo this value can be changed accordingly. It is always preferable to take TIMER2 because only here are enough discrete steps available to position the servo accurately. The values are in a certain interval (see motor), independent of the CPUclock.

int pwm_start:

This is the minimal hightime of the pwm period in us. Valid values are 0..pwm_period

To position a servo the two extreme positions for it have to be defined. In the normal case a servo needs to have a minimal hightime of 0.7ms (700us) at the beginning of each pwm period. This is also one of the two extreme positions a servo can take.

int pwm_stop:

This is the maximum hightime of the pwm period. Valid values are 0..pwm_period. Depending on the rotation direction of a servo, one may choose pwm_stop less than or greater than pwm_start.

To position a servo the two extreme positions for it have to be defined. In the normal case a servo needs to have a maximum hightime of 1.7ms (1700us) at the beginning of each pwm period. This is also one of the two extreme positions a servo can take.

All other positions of the servo are linear interpolated in 256 steps between these two extremes.

Hint: If you don't need the full range the servo offers you can adjust the start and stop parameters to a smaller 'window' like 1ms to 1.5ms and gain a higher resolution in these bounds. Or the other way around, you can enlarge the 'window' to adjust the values to the real degrees the servo changes its position: Take for example a servo that covers a range of 210 degrees. Simply adjust the stop value to 1.9ms. If you now set values between 0 and 210 you will reach the two extremes in steps corresponding to the real angles. Values higher than 210 would not differ from the result gained by the value of 210.

C.14 Startimage Entry

typedef BYTE image_type[16*64];

e.g.

image_type startimage = {0xB7,0x70,0x1C,...0x00};

Here a user-defined startup image can be entered as a byte array (16*64 = 1024Bytes).

This is a 128x64 Pixel B/W picture where each pixel is represented by a bit.

C.15 Startmelody Entry

no typedef

e.g.

int startmelody[] = {1114,200, 2173,200, 1114,200, 1487,200, 1669,320, 0};

Here you can enter your own melody that will be played at startup. It is a list of integer pairs. The first value indicates the frequency, the second the duration in 1/100s of the tone. As last value there must be single 0 in the list.

426


VW Drive Entry

C.16 VW Drive Entry

typedef struct

{

version;

int

int

drive_type;

drvspec

drive_spec; /* -> diff_data */

}vw_type;

typedef struct

{

quad_left;

DeviceSemantics

DeviceSemantics

quad_right;

float

wheel_dist; /* meters */

}diff_data;

e.g.

vw_type drive = {0, DIFFERENTIAL_DRIVE, {QUAD_LEFT, QUAD_RIGHT, 0.21}};

int driver_version:

The maximum driver version for which this entry is compatible.

Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.

int drive_type:

Define the type of the actual used drive.

Valid values are DIFFERENTIAL_DRIVE (ACKERMAN_DRIVE, SYNCHRO_DRIVE, TRICYCLE_DRIVE)

The following parameters depend on the selected drive type.

DIFFERENTIAL_DRIVE:

The differential drive is made up of two parallel independent wheels with the kinematic center right between them. Obviously two encoders with the connected motors are needed.

DeviceSemantics quad_left:

The semantics of the encoder used for the left wheel.

DeviceSemantics quad_right:

The semantics of the encoder used for the right wheel.

float wheel_dist:

The distance (meters) between the two wheels to determine the kinematic center.

C.17 Waitstates Entry

typedef struct

{

short version; short rom_ws; short ram_ws; short lcd_ws; short io_ws; short serpar_ws;

}waitstate_type;

e.g.

waitstate_type waitstates = {0,3,0,1,0,2};

int version:

427


C Hardware Description Table

The maximum driver version for which this entry is compatible.

Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.

short rom_ws:

Waitstates for the ROM access Valid values (for all waitstates):

waitstates = 0..13, Fast Termination = 14, External = 15

short ram_ws:

Waitstates for the RAM access

short lcd_ws:

Waitstates for the LCD access

short io_ws:

Waitstates for the Input/Output latches access

short serpar_ws:

Waitstates for the 16c552 Serial/Parallel Port Interface access

Thomas Bräunl, Klaus Schmitt, Michael Kasper 1996-2006

428

HARDWARE

D

SPECIFICATION

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . .

The following tables speficy details of the EyeCon controller hardware.

Version

Features

Mark 1

First prototypes, two boards, double-sided, rectangular push

button, no speaker

Mark 2

Major change: two boards, double-sided, speaker and micro-

phone on board, changed audio circuit

Mark 2.1

Minor change: connect digital and analog ground

Mark 3.0

Completely new design: single board design, four layers, di-

rect-plug-in connectors for sensors and motors, motor control-

lers on board, BDM on board, wireless module and antenna on

board

Mark 3.11

Minor change: miniature camera port added

Mark 3.12

Minor change: replaced fuse by reconstituting polyswitch

Mark 4.02

Major change: extension to 2MB RAM, adding fast camera

framebuffer, additional connector for third serial port, redesign

of digital I/O

Mark 5

Major redesign: camera plugs in directly into controller, new

motor connectors, video out, additional servo connectors

Table D.1: Hardware versions

429429


D Hardware Specification

Chip Select

Function

CSBOOT

Flash-ROM

CS 0+1

RAM (1MB)

CS 2

LCD

CS 3+7

RAM (additional 1MB)

CS 4

Input/Output latch (IOBase)

CS 5

FIFO camera buffer

CS 6

Address A19

CS 7

Autovector acknowledge generation

CS 8

Parallel port of 16C552

CS 9

Serial port 1 of 16C552

CS 10

Serial port 2 of 16C552

Table D.2: Chip-select lines

Address

Memory Usage

Chip Selects

0x00000000

RoBIOS RAM (128KB)

CS0,1,3,7

0x00020000

User RAM (max. 2MB-128KB)

CS0,1,3,7

0x00200000

End of RAM

...

unused addresses

0x00a00000

TpuBase (2KB)

0x00a00800

End of TpuBase

...

unused addresses

0x00c00000

Flash-ROM (512KB)

CS2

0x00c80000

End of Flash-ROM

...

unused addresses

0x00e00800

Latches

CS4

0x00e01000

FIFO or Latches

CS5

0x00e01800

Parallel Port/Camera

CS8

Table D.3: Memory map (continued)

430