Table of Contents
- PIC16F84 + ADXL202
- Hardware
- Software
- Hardware
- H8/3694F + ACB302 + EEPROM
- Hardware
- Software
- Hardware
PIC16F84 + ADXL202
Hardware
- PC connected micon 2 axis acceleration sensor module kit [akizukidenshi.com]
- PIC16F84
PIC16F628: compatible pin assign with PIC16F84
- ADXL202 [analog.com]
Software
$ make $ ./sensor -h Usage: sensor [-hd] [-p serial-device] -h help -d power off serial port default serial-device : /dev/ttyS0 $ ./sensor > 20020807.log.3
raw data: 20020807.log.3 (format: index x-acceleration y-acceleration x-speed y-speed x-position y-position)
gnuplot> set xzeroaxis lt -1 gnuplot> set yzeroaxis lt -1 gnuplot> set ticslevel 0 gnuplot> set xlabel "x-speed" gnuplot> set ylabel "y-speed" gnuplot> set zlabel "index" gnuplot> set terminal png color gnuplot> set output "20020807.log.3.speed.png" gnuplot> splot "20020807.log.3" using 4:5:1 with line
acceleration: 20020807.log.3.accel.png speed: 20020807.log.3.speed.png position: 20020807.log.3.position.png position animation (QuickTime): plot-line.qt presented by YOKOBORI Masayuki (miyabi at uranus.interq.or.jp)
H8/3694F + ACB303 + EEPROM
Hardware
Block diagram
Parts
- AKI-H8/3694F (QFP) Tiny Micon Kit [akizukidenshi.com] 20MHz (!16MHz)
H8/3694F [renesas.com] ROM 32kbyte, RAM 2kbyte, 10bit ADC, Timer, SCI, I2C
- H8 Tiny I/O board [akizukidenshi.com]
- ACB302 3-Axial capacitve Acceleration sensor with amplifier [Star Micronics]
Data Sheet [servoflo.com]
Application Note [servoflo.com]
- AT24C1024 [atmel.com] I2C 1Mbit EEPROM
17bit address width = {1bit: page switch, 16bit: address}
Philips Semiconductors IC-bus Information [philips.com]
Schematics
Qt-BSch3V [suigyodo.com]
$ tar zxvf qbsv010.tgz $ cd qtbsch3v $ qmake -project $ qmake $ make
Qt-LCo [suigyodo.com]
$ tar zxvf qlco005.tgz $ cd qtlco005 $ qmake -project $ qmake $ make
Schematics: am.png, am.ce3 Libraries: ae-3694.lb3, acb302.lb3, at24c1024.lb3 pin assignment [docs.google.com]
Software
h8300-hms development enviroment
building log
binutils-2.16: successgcc-3.4.4 (with newlib-1.13.0): failgcc-3.4.3 (with newlib-1.13.0): failgcc-3.3.2 (with newlib-1.13.0): successnewlib-1.13.0 (by gcc-3.3.2): failgcc-3.3.2 (with newlib-1.11.0): success newlib-1.11.0 (by gcc-3.3.2): success
The summary of compilation logs in the case of success
binutils-2.16
$ tar jxvf binutils-2.16.tar.bz2 $ cd binutils-2.16 $ ./configure --target=h8300-hms $ make # make install
newlib header
# cd /usr/local/src # tar zxvf newlib-1.11.0.tar.gz
gcc-3.3.2
$ tar jxvf gcc-3.3.2.tar.bz2 $ cd gcc-3.3.2 $ mkdir work $ cd work $ ../configure --target=h8300-hms --with-newlib \ --with-headers=/usr/local/src/newlib-1.11.0/newlib/libc/include \ --enable-languages=c $ make # make install
long 32bit, int 16bit (without -mint32), short 16bit, char 8bit
newlib-1.11.0
$ tar zxvf newlib-1.11.0.tar.gz $ cd newlib-1.11.0 $ mkdir work $ cd work $ ../configure --target=h8300-hms $ make # make install
Writer
Open SH/H8 writer [mes.sourceforge.jp]
Monitor
"Transistor Gijutsu" April 2004 CD-ROM: TR0404SP/support/ Hew/hterm_monitor/monitor/Release/monitor.mot
H8/3694 Series Normal Mode Monitor Ver. 2.0A Copyright (C) 2003 Renesas Technology Corp. : ? Monitor Vector 0000 - 003F Monitor ROM 0100 - 4B09 Monitor RAM F780 - F83F User Vector F840 - F87F
Terminal: hterm [Renesas.com] , hterm.c
Sampling
calibration_02.tar.bz2 Moved to the Subversion repository.
3664.mon.x: linker script for the above monitor 3664.rom.x: linker script for rom program 3694S.h Makefile adc.[ch]: ADC driver cal.[ch]: main routine for calibration (dumping out through SCI) crt0.S: start up routine i2c.[ch]: I2C driver sample.c: main routine to store data into EEPROM sci.[ch]: SCI driverIO.PMR1.BIT.TXD = 1; /* Set P22 to TXD function **/log/*: calibration data
$ make
Plotting graph from sampling raw data:
$ ./genplot.pl data.log (generates data.log.dat and data.log.plt from RS232C log file) $ gnuplot data.log.plt (generates data.log.png) $ qiv data.log.png
First sampling raw data: togawa.log.png, okazaki.log.png, long.log.png, 0613.log.png
Calibration
Calibration method: 3d.pdf
Calibration data:xp.log, xp.log.png, x-.log, x-.log.png yp.log, yp.log.png, y-.log, y-.log.png zp.log, zp.log.png, z-.log, z-.log.pngAverage:
$ ./ave.pl data.log (calculates the averages from log file: *.log)
ave.xls (includes the following table and graphs)
Results
Offset:$ vi offset.pl (edit offset values and scales for each axis) $ ./offset.pl data.log $ gnuplot data.log.offset.plt $ qiv data.log.offset.pngSampling rate: 0.5 sec (cal.c: TA.TMA.BYTE = 0x99;)
20050804.log (raw data) 20050804.log.png (raw data graph) 20050804.log.offset.png (raw - offset and bezier curve for each axis) 20050804.log.offset.3d.png (raw - offset 3D) According this result, it is considered that the sampling rate (0.5 sec) is too long.Sampling rate: 0.03125 sec (cal.c: TA.TMA.BYTE = 0x9b;)
20050806.log (raw data) 20050806.log.png (raw data graph) 20050806.log.offset.png (raw - offset andbezier curvemoving average for each axis) 20050806.log.offset.3d.png (3D: raw - offset moving average)gnuplot> set xrange [-1.5:1.5] gnuplot> set yrange [-1.5:1.5] gnuplot> set zrange [-1.5:1.5] gnuplot> set terminal x11 gnuplot> splot "20050806.log.offset.dat" using 5:6:7 w l (column 5:6:7 is moving averages.)ag0205.swf presented by YOKOBORI Masayuki (miyabi at uranus.interq.or.jp)(If you rotate the graph with a mouse, it is found that the noise signal may have another axis?!)gnuplot> set terminal png gnuplot> set output "20050806.log.offset.3d.png" gnuplot> replot
Staff
- TOGAWA Satoshi
s-togawa at tkd.att.ne.jp
- OKAZAKI Atsuya