Saturday, June 02, 2018

I recently purchased a board from  nandland.com  called the Go board.

It is a small  fpga board designed by the xxxxxxx   as an  educational tool
to learn either  verilog or vhdl  and some commercial software tools.

However since the board is based on a lattice 1k design  there is now
a suite of open source tools that can be used for simulation or
synthesis. 

iverilog         verilog compiler  comes with simulation tool  vvp


yosys             framework for verilog  RTL synthesis     

arachne-pnr    place and route software  for lattice  1k and 4k chips

icestorm         general  tools  for lattice chips and boards


The  EE  has  the website   nandland.com   and  also a youtube channel
which provides a great educational resource for a beginner interested
in learning about fpga boards.

An interesting approach the author has taken is to combine  vhdl  and
verilog code on the same web page  for each project.

Since I don't know anything about vhdl,   I am getting some exposure
but learning verilog   with the free compiler  iverilog is enough of
a challenge for now.

 I have verified that most of the verilog code on nandland.com can
run on the go board using  fedora linux   and  the other tools listed.

 The Go board comes with  4 switches, 2 7 Segment leds, a VGA port
and  a pmod port. 

Communication with the Go board is through the micro usb port on
the board with a linux pc.


I am building up a library of  gates and other digital logic and the
test bench code so  anyone can  learn  about  fpga's   using
linux.






Saturday, March 17, 2018

ngspice


fedora 27  amd/gpu  4 processor mb  16Gb memory

I have been learning about ngspice  - a circuit simulator

Circuits are defined in a text file by components and nodes.
So if you want to run ngspice on a netlist file it can be
as simple as cut and paste into a text file on your system
and then run         ngspice  sample-netlist.net          


Allaboutcircuits.com   was a resource that I used  to test a variety of models
that they described on the site.  It is a bit dated though so I have modified
a few of the netlists to work on ngspice.



I will post the modified circuits online once I figure out where.



Thursday, May 28, 2009

fedora core 11 python notes

some additional rpm packages for python 2.6
yum install

setuptools, setuptools-devel you need the devel package if you want to use
easy_install


numpy i586 1.3.0-4.fc11 fedora 2.0 M

Installing for dependencies:
blas i586 3.1.1-5.fc11 fedora 345 k
lapack i586 3.1.1-5.fc11 fedora 3.7 M
python-nose noarch 0.10.4-2.fc11 fedora 291 k


PyOpenGL noarch 3.0.0-0.12.b8.fc11 fedora 1.2 M

Installing for dependencies:
freeglut i586 2.4.0-16.fc11 fedora 148 k


yum install gle


some source packages from sourceforge install in the order listed

PyDispatcher-2.0.1.tar.gz
PyVRML97-2.2.0a1.tar.gz
OpenGLContext-2.1.0a2.tar.gz



the usual gzip -d , tar xvf, cd to the directory with setup.py
then su -c "python setup.py install"

when searching for the pyopengl you need to rpm -qa | grep PyOpenGL

Tuesday, May 05, 2009

garmin oregon 400c

purchased new in april 2009 the marine chart version 400c.

ordered the invisible shield screen protector from zagg.com. expensive but worth it in my opinion. a bit difficult to install and very visible bubbles and bumps but it seems okay now and zagg stated that is would smooth out after a few days.

Finding the usb drivers for the usb cable was somewhat difficult, though it isn't actually
necessary just for the software updates.

In the past 2 or 3 weeks there have been three software updates from garmin and I have installed all of them. On linux the sw update is particularly easy. plug the unit in and the drives are automatically mounted. unzip the download from garmin and copy the update file to the gps.

I have been doing quite a bit of searching and reading on adding maps to the gps. Naturally I was wondering if there were free maps available so I could see what they would look like.

after about 2 weeks of fumbling around trying various software packages I found this site

http://www.gpsfiledepot.com/

Here is my synopsis

01. download and install garmin training center software
http://www8.garmin.com/support/download_details.jsp?id=835

02. download and install garmin mapsource update
http://www8.garmin.com/support/download_details.jsp?id=209

03. at gpsfiledepot.com go to the link custom maps. select a state and if there is a free
map download it. Note the california map was over a gigabyte and the download took
multiple hours to complete.

04. The california topo maps download was an executable that automatically installs
the files in mapsource.

05. Open mapsource load the map and then tranfer the map to the microsd
card in a card reader. Also after transferring the map to the sd card it will
be called mapsupp.img. Save the file with a new name on your hardrive
probably a new that identifies the map, then you can quickly change the
maps on the microsd card.

Saturday, April 22, 2006

Calculating logarithms





After reading how Napier and Briggs calculated some values for the first log tables,
I decided to follow the procedure and post a summary
The method I used was explained on mathforum.org in these two posts but I decided to
limit the calculations to 7 decimal places

http://mathforum.org/library/drmath/view/51432.html
http://mathforum.org/library/drmath/view/55600.html



01. let x = 8th root of ten, which will give us a
number close to 1.01

x = 10^2^-8
x = sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(10))))))))
1 2 3 4 5 6 7 8

from a 4 function calculator take sqrt(10) 8 times

sqrt01 sqrt(10) = 3.1622776
sqrt02 sqrt(3.1622776) = 1.7782793
sqrt03 sqrt(1.7782793) = 1.3335213
sqrt04 sqrt(1.3335213) = 1.1547819
sqrt05 sqrt(1.1547819) = 1.0746077
sqrt06 sqrt(1.0746077) = 1.0366328
sqrt07 sqrt(1.0366328) = 1.0181516
sqrt08 sqrt(1.0181516) = 1.0090349


02. log(10^2^-8) = 2^-8*log(10) = 2^-8

2^-8 is the same as 1/2^8 or 1/256

log(10^2^-8) = log(1.0090349) = 1/256
from a 4 function calculator 1/256 = 0.0039062


03. assume that log is continous and can be approximated
by a straight line near 1 in the interval from
1 to 1.009... and 1.01
what the formula says below is that the slope of the lhs
is approximately equal to the slope of the rhs


log(x2) - log(1) log(x1) - log(1)
-------------------- =~ ---------------------
x2 - 1 x1 - 1


log(1.01) - log(1) log(10^2^-8) - log(1)
-------------------- =~ -----------------------
1.01 - 1 1.0090349 - 1


x2 - 1
log(x2) =~ ------ * log(x1) since log(1) = 0
x1 - 1


1.01 - 1
log(1.01) =~ -------------- * 0.0039062
1.0090349 - 1


0.01
log(1.01) =~ --------- * 0.0039602 = 0.0043235
0.0090349

or in pari/gp terms
log(1.01) =~ (1/100)/( 10^2^-8 - 1) * 1/256


04. Here the rules for exponents, and correspondingly
logarithms are used to find log(2)

log(2^10/10^3) = log(1024/1000) = log(1.024)

The lhs becomes 10*log(2) - 3*log(10) and since
log(10) = 1 is 10*log(2) -3

log(1.024) = 10*log(2) - 3


05. A linear approximation is applied for log(1.024)


log(1.024) - log(1) log(1.01) - log(1)
------------------- =~ -------------------
1.024 - 1 1.01 - 1


0.024 0.024
log(1.024) =~ ------- * log(1.01) = ------- * 0.0043235
0.01 0.01


log(1.024) =~ 2.4 * 0.004325 = 0.0103764

log(1.024) = 10*log(2) - 3 = 0.0103764

10*log(2) = 3.013764

log(2) = 0.3010376


06. Use pari/gp to look at the accuracy of the estimate

log(2)/log(10) - (3 + 2.4*(1/100)/( 10^2^-8 -1) * 1/256)/10

The log base 10 value for log(2) to 7 dec places

0.3010299 versus the above approximation 0.3010376
good to 5 decimal places.




Monday, April 17, 2006

mingw build gnuplot on winxp

Looking into building gnuplot on windows, the prerequisites were zlib, jpeg, libpng, gd, libiconv and gnuplot. It is probable that some of these prerequisites are not absolutely necessary but I definitely wanted png output.

mingw build consist of mingw3.1.0, minimal system 1.0.10 and msys developer kit 1.0.1
editor is vim. 7-zip used for unzipping and untarring. HelpWorkshop is needed for compiling the help file. The gnuplot makefile mentions the microsoft SDK but isnt necessary if you have the help compiler.
It also has a line for sort.exe which I ignored.



01. download zlib-1.2.3.tar.gz from www.zlib.net scroll down to the link
gunzip and untar (7-zip) or MSYS shell

from an MSYS shell
./configure
make
make -n install -n shows where the files would be installed
make install


02. download jpegsrc.v6b.tar.gz from http://www.ijg.org/files/
gunzip and untar (7-zip) or MSYS shell

from an MSYS shell
./configure
make
skip the make install as it doesn't install the include file and libraries

copy to /usr/local/include/
jconfig.h, jerror.h, jpeglib.h, jmorecfg.h

copy to /usr/local/lib libjpeg.a

03. download libpng-1.2.9.tar.bz2 from sourceforge you can link from the home page
http://www.libpng.org/pub/png/libpng.html
gunzip and untar (7-zip) or MSYS shell

edit scripts/makefile.mingw
line 44 change prefix=/usr to prefix=/usr/local
lines 50,51 to the location of zlib include and lib directories
ZLIBLIB= /usr/lib to ZLIBLIB=/usr/local/lib
ZLIBINC= to ZLIBINC=/usr/local/include

from an MSYS shell
cd back to the main directory out of the scripts subdirectory
make -f scripts/makefile.mingw
once again make install doesnt work so files have to be copied
manually

copy to /usr/local/include png.h pngconf.h
copy to /usr/local/lib libpng.a libpng.dll.a


04. download from http://www.mingw.org/download.shtml
libiconv-1.9.2-mingwPORT.tar.bz2
then download
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz

gunzip and untar (7-zip) or MSYS shell
first libiconv-1.9.2.tar.gz then libiconv-1.9.2-mingwPORT.tar.bz2

from an MSYS shell
cd to the mingwPORT subdirectory

./mingwPORT.sh

Download file? (Yes) no
Unarchive file? (Yes) no
Source path? (/usr/src/libiconv-1.9.2) /d/prog/devl/temp/libiconv-1.9.2
Installation Directory? (/mingw) /usr/local
CFLAGS (-O3 -s -mms-bitfields -march=-686)

The mingwPORT.sh shell script will then compile the source code
and install the files in /usr/local.
I should mention that libiconv is probably not necessary to compile
gnuplot but since I already had it installed, it needed to be worked
into the process and documented.

05. download from http://www.boutell.com/gd/ scroll to the bottom
for the link to the download

http://www.boutell.com/gd/http/gd-2.0.33.tar.gz

gunzip and untar (7-zip) or MSYS shell

Preliminary steps before compiling gd

cd /usr/local/include -- depending on where you installed msys
could be c:\pathtomsys\msys\1.0\local\include

edit file jmorecfg.h and comment out lines 160-162 due to
confliting types with /MinGW/include/basetsd.h
use c comments /* something */

in the gd subdirectory edit gd-2.0.33/gkanji.c
comment out line 24 typedef void *iconv_t due to a
conflict with libiconv

from an MSYS shell
cd /gd-2.0.33
run configure like this
CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure

edit Makefile line 233 from -- to
DEFS = -DHAVE_CONFIG_H
DEFS = -DHAVE_CONFIG_H -DBGDWIN32 -UNONDLL

make
make install

I would like to recognize my source for the makefile change and gd.h patch

http://mailman.lyra.org/pipermail/viewcvs/2005q3/003747.html

Also although the configure completed and flagged that it couldnt find
zlib, it didnt occur to me to use CFLAGS andLDFLAGS until I saw an
email that mentioned

gdparttopng.c needs the function named gdImageCreateFromGd2Part which is
supposed to be found at the shared library named libgd.so. The object
file named gd_gd2.o provides this function for libgd.so. However, the
function gdImageCreateFromGd2Part is only defined in gd_gd2.o if you
have zlib installed.






06. download from ftp://ftp.gnuplot.info/pub/gnuplot/
ftp://ftp.gnuplot.info/pub/gnuplot/gnuplot-4.0.0.tar.gz

gunzip and untar (7-zip) or MSYS shell

Preliminary steps before compiling gnuplot
Apply the following patch to gd.h which should be located in
/usr/local/include

--- ./gd.h Sat Oct 30 12:54:58 2004
+++ ./gd.h Wed Aug 24 12:18:09 2005
@@ -22,9 +22,9 @@
#ifndef WIN32
#define NONDLL 1
#endif /* WIN32 */
-
+#define NONDLL
#ifdef NONDLL
-#define BGD_DECLARE(rt) extern rt
+#define BGD_DECLARE(rt) extern rt _stdcall
#else
#ifdef BGDWIN32
#define BGD_DECLARE(rt) __declspec(dllexport) rt __stdcall


copy the above text to some file name example: gd_h.patch

copy from /usr/local/include to /gnuplot-4.0.0/term/

gd.h
gdfx.h
gd_io.h
and the patch file gd_h.patch

from an MSYS shell
cd gnuplot-4.0.0/term

apply the patch file

patch -p0 < gd_h.patch note that -p0 is -pzero

copy /gnuplot-4.0.0/config/makefile.mgw to
/gnuplot-4.0.0/src/

edit makefile.mgw

makefile edits

DESTDIR
DESTDIR = d:/prog/devl/gnuplot-test
GCCPATH
GCCPATH = d:/prog/devl/MinGW/bin
HCWPATH
HCWPATH = d:/nonfree/HelpWorkshop-sa
MSSDK
MSSDK = d:/Program Files/Microsoft SDK
GNUSORT
GNUSORT = d:/cygwin/bin/sort.exe
FREETYPE=1 comment out this line

if you have helpworkshop installed the location of mssdk, is bypassed

cd /gnuplot-4.0.0/src
CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib make -f makefile.mgw

assuming all the above was done you should have wgnuplot.exe in you source directory
I didnt run make install yet so details on that later

Wednesday, April 12, 2006

winxp mingw build abiword and bonecho

Visted my brother in law and used his dsl line to download several large files.

abiword-2.4.2.tar.gz gunzipped and untared it is 106MB somewhat of a strange build in that you only use make, which the notes refer to as a diving make? Anyway only a couple of problems were encountered.

01. had to copy zlib.h and zconf.h to libpng from zlib

02. had to comment out #define NOGDI from

\abiword-2.4.2\abi\src\af\util\win
\abiword-2.4.2\abi\src\af\xap\win

03. had to create a directory
\abiword-2.4.2\libs\zlib\lib containing libzdll.a
or more simply everything in the lib subdirectory from
zlib123-dll.zip

This last step was trialed until the link completed the error being cannot find -lzdll

Later I will try to edit the makefile but without configure, this seems the more practical solution


**********

Details in an earlier post but cygwin compiled the firefox bonecho source without incident. The binary chokes on some web pages and dumps but I was able to use nightly tester tools to install all my favorite extensions.
I have been using it every day and except for some bookmark problems and the same slow scrolling using the up and down scroll buttons, it is the same as the cygwin build for firefox 1.5