Remote Sonar Sensing over TCP/IP
Download
Report
Transcript Remote Sonar Sensing over TCP/IP
Remote Sonar Sensing over
TCP/IP
Patrick McGinty and Dave Morse
Project Overview
Implement a TCP/IP stack on the NEC
78F9418 Flash Microcontroller
Interface with Cirrus Crystal CS8900A
Ethernet controller chip in 8-bit mode
Sonar sensor on a servo motor used for
distance ranging
Remote software applet to control the
system over the Ethernet
System Block Diagram
NEC 78F9418 Microcontroller
LCD controller/driver: 28x4 segments
32 Kb of Flash EPROM
0.4us min. instruction execution time (5 MHz clock)
A/D converter: 7 channel 8/10 -bit
Serial interface UART/CSI
8/16-bit timer
Watchdog timer
43 I/O ports
Interrupt controller
Clock prescaler
Subsystem clock: 32.768 kHz
Layered approach
TCP/IP functionality supported
Limited RAM and code space, so not a fully
functional stack
Will support basic TCP, UDP, and ICMP
packets
Will support 2 concurrent TCP connections
Will not support packet fragmentation, due to
limited RAM space
Packets are buffered in the Ethernet
controller and processed by the microcontroller as they are read in
What are the limitations?
512 bytes of RAM, so packet size must be limited
Need to reserve RAM for high level application (sonar),
connection maintenance, and general processing
Incoming TCP packets are only control data packets, will not
require more than the minimum of 64 bytes
Incoming packets that are too large to fit in RAM will be ignored
System will be limited (for now) to having two simultaneous
connections
Outstanding packets will be limited to one packet, so out of
order packets will be ignored
Under this scheme, the number of packets that can be in RAM
at one time is limited to two
The Ethernet controller chip has 4K of buffer RAM which will
hold incoming packets until they can be processed in RAM
Application software
High level remote application on PC that
communicates with micro controller over the Ethernet
Remote application controls a sonar sensor mounted
to a servo motor to perform remote distance sensing
Software supports a variety of control functions, and
receives data from the sonar over the Ethernet
The software will demonstrate both TCP and UDP
communications with the micro controller
Server can respond to ping operations to
demonstrate ICMP support
Commands available
Reset motor position to initial position
(straight ahead, 0 degrees)
Move arm counterclockwise 15 degrees
Move arm clockwise 15 degrees
Sense
Query position
Sweep
180 degree dynamic range / 15 degree beam
angle = 12 possible positions for the motor
Sonar distance calculations
Polaroid 7000 sonar transducer
Distance: 6 inches to 35 feet
Pulse returned when echo comes back
Time from pulse sent to pulse returned
caught with an interrupt, and this data is
used to determine distance
Error: Sensor specs claim within 1% of
calculated value, testing will have to verify
Feasibility study
Most difficult problem is handling packet
processing given limited RAM space
RAM will be needed to store the state of 2
TCP connections, 2 packets of at least 64
bytes, servo state, and RAM needed for
general processing
512 bytes will be enough RAM for these
operations given that packet fragmentation is
not supported and the number of outstanding
packets is limited to one