UNIX ON PIC32 – meet RetroBSD for DuinoMite

UNIX ON PIC32 – meet RetroBSD for DuinoMite

Image

Can you run UNIX on PIC32 with onlt 128KB of RAM? Yes absolutely! Serge Vakulenko proves this with his RetroBSD port for PIC32 (MIPS).

The project is hosted at http://retrobsd.org/

Serge did amazing job by porting the old days  2.11BSD Unix used to run on PDP-11 to PIC32 (MIPS). In just 128KB RAM footprint he manage to boot UNIX OS and you have 96KB left for applications.

 

RetroBSD is multi tasking and you have access to the PIC32 GPIO and ADCs via API, so you can write embedded applications on it!

To make your DuinoMite Unix machine you need:

1. To download RetroBSD compiled image from http://retrobsd.org/wiki/software-2/ the release I check is retrobsd-duinomite-r425.zip

the files inside are UNIX.HEX which contains PIC32 firmware, filesys.img which contains the SD card disk image with the different tools

2. Unpack on your local drive, there are few files you need: Bootloader is same as Olimex DuinoMite bootloader so you may not need it if you have already Olimex bootloader installed

the filesys.img this is the UNIX diskcontent you should write it to SD-card, for Windows users you need Win32 Image writer software, download from https://launchpad.net/win32-image-writer/+download you have to open the filesys.img with Win32DiskImager and to write it to SD card.

3. then you have to put the written SD card in DuinoMite and press reset+button to put DuinoMite in bootloader mode and launch USB Bootloader v2.90a to write Unix.HEX file (the Bootloader in the RetroBSD zip didn’t work for me for some reason)

4. when finished you press reset and Duinomite will boot RetroBSD, if you are under Linux there will be no need for USB CDC drivers as Linux will load them automatically, Ifyou are on Windows you have to point it to DuinoMite CDC Virtual com port drivers.

5. check which virtual com port is created (in linux you can do this in termianl mode by running dmesg | grep tty* command, in windows you can check in device manager which com port is created when you plug in DuinoMite) and run terminal program minicom for linux or hyperterminal for windows

you will see this welcome message on top of this post, login is logically root with empty password

Image

 

you can see the tools by listing the bin folder:

Image

As you see you got CC compiler, I immediately wrote hello world, but for some reason it fails to compile, I guess I have to RTFM :) ))

Image

Anyway I’m amazed how fast this RetroBSD works on PIC32, actually it works faster than the Linux on my 3Ghz machine. I guess because it’s very lightweight and have no so much features as real Linux.

It boots in 2 seconds, CC compiles in 1 second!

 

Posted in Applications, News | Tagged , , , | Leave a comment

DuinoMite is now on GitHub

DuinoMite is now on GitHub

From Tsvetan of Olimex:

DuinoMite software development was suffering from missing version control since we started it. There are 4 developers who contributed to the project but there was quite lack of coordination as we put all stuff on Ken’s shoulders.

Ken’s release from February 16th, 2012 was with few minor bugs on the UART configurations, but being busy he had no time to fix these. This weekend I had some free time after we finish the iMX233-OLinuXino design and took a look at the sources and fixed few port definition and UART initialization mistakes.

Now the source is on GitHub https://github.com/OLIMEX/DuinoMite

I put there also the latest Hardware CAD files and from now on the latest revisions will be there.

Posted in News | Tagged , , , , , , , | Leave a comment

Serial Communication Between two Duinomites: A Tutorial

Serial Communication Between two Duinomites: A Tutorial

This tutorial is based on MMBASIC 2.7A. Using 3.1 is not advised as the pin mappings for the Duinomite are not the same or not yet corrected

The Duinomite has a ton of written libraries that enable many cool features. For instance there is probably not a microcontroller out there where it is easier to utilize the sd card. For example to write to SD you simply type:

 

100 open “mytext.txt” for output as #1

200 print #1, “Test Text”

300 close #1

 

In the case above a file called mytext is created and the contents of line 200 are saved to the file. In this case it easy to save data to information in mmbasic. This ease of use, however, does not stop with the SD card writes.

Another example where this is evident is with the use of serial communication. MMbasic has a serial “library” written in order to make serial communication just as easy as using the file save. It can be done by just following the 4 steps.

  • Select the appropriate com ports you are going to use.
  • Connecting the correct wires to the configured com ports.
  • Writing the code on each Duinomite.
  • Running the code and checking the output

With this being said let us jump right in.

1. Select the appropriate com ports you are going to use

Looking at the Duinomite user guide we can see the choices for COM ports as follows:

Pin assignments:
COM1: RX is Arduino.D2 or GPIO.13;
TX is Arduino.D3 or GPIO.14;
RTS is Arduino.D4 or GPIO.15 (if FC is used);
CTS is Arduino.D5 or GPIO.16 (if FC is used);
COM2: RX is Arduino.D6 or GPIO.17;
TX is Arduino.D7 or GPIO.18;
COM3: RX is UEXT.4;
TX is UEXT.3;
COM4: RX is RS232.Rx if R2 is mounted also Arduino.D0 or GPIO.11;
TX is RS232.Tx if R3 is mounted also Arduino.D1 or GPIO.12;

In the  case of this project we will use com4. I chose this port rather arbitrarily although you are free to choose whatever port you would like. There are speed considerations though so you might want to read up on that.

2. Connecting the correct wires to the configured com ports.

Now that we have chosen a com port we need to hook up the two Duinomites. We see from above the COM4 uses an Arduino-type pin D0 or GPIO 11. A reliable chart for the pin outs can be found on page 18 of the user manual or here below. In this project I will be using a Duinomite mini as the sender and a mega as the receiver. The mini has no “Arduino” pins but it does have a GPIO port. It is best to think of the RX as the receiver and the TX as the sender. If the Mini is the sender then we can plug 12 of the GPIO port to pin D0 on the mega (or pin 11 of the GPIO of any of the three boards). We also have the RX port which is pin 11 of the GPIO port of the Duinomite (D12). This is connected to pin D0 of the Duinomite Mega or GPIO 11.

MEGA              MINI

D0 <————>12

D1 <————>11

Although in this tutorial the mega will not be sending anything I have gone ahead and connected both ports. Now that we are hooked up it is time to write the program.

 

Writing the code on each Duinomite.

The next step is to put the code in each Duinomite. The first code you will enter is the sender or in my case the Duinomite mini. Then you will write the code for the Mega (or whatever model you are using). Below are the two code examples and I must stress they are very simple examples. The only purpose is to get the communications flowing. After this you can spice the code up any way you like.

1 REM SENDER CODE! (duinomite mini)

100 OPEN “COM4:54000″ AS #2 /HERE YOU ARE OPENING COM SERIAL PORT
200 SETPIN 1,1 /READING FROM ANALOG PIN #1
300 SETPIN 2,1 /READING #2
400 PRINT #2, PIN(1) /SENDING
410 PRINT #2, PIN(2) /SENDING
450 GOTO 400  /JUST GOES ON FOREVER
600 CLOSE #2 /NEVER GETS HERE BUT HEY YOU KNOW….

Now we are going to enter the code into the other Duinotmite (in my case the mega).

100 OPEN “COM4:54000,15000″ AS #3 /OPEN COM PORT WITH 15 KB BUFFER
200 STRING$=INPUT(10,#3) /READ COM PORT AND ASSIGN DATA TO STRING
300 PRINT#3, STRING$; /PRINT IT
400 GOTO 200

Running the code and checking the output

Now we are ready to run the code. It does not matter which machine you start first. I started the mini first but and the mega second. The output below might be a bit different than what you get as I played around with the code to change the output. The can be done by adding a semi-colon after the output Take a look:

 

Posted in Applications | Tagged , , , , , | Leave a comment

MaxiMite-12Pin-DM-Mini

Product: 17011
All Dontronics MaxiMite Computer products are located at:
 
http://www.dontronics-shop.com/the-maximite-computer.html

MaxiMite-12Pin-DM-Mini

You want to join in the fun that users are experiencing with the MaxiMite computer, and be able to create hardware and software applications in minutes, and not hours or days, but the $90AUD for a kit, is far too high to even think about it.

How about an assembled and tested unit at about a third of that price?

There simply is no cheaper way of getting any MaxiMite up and running, unless you are building your own from scratch.

This product will have 12 GPIO pins compared to the normal 20 GPIO pins of a standard MaxiMite, but at a third of the price, you could actually have three talking to each other, and still have a lot more pins than a standard MaxiMite.

I believe that 85% of all home-brew hardware applications use 12 or less GPIO pins. See: http://www.duinomite.com/duinomite-ultra-budget-computer-system-for-slot-cars/ for what can be achieved with a 12 pin DuinoMite running under MaxiMite MM-Basic.

I hear you say: "This board looks suspiciously like a DuinoMite-Mini". It should, as it is a DuinoMite-Mini.

Geoff Graham has been good enough to compile a DuinoMite version of his MM-Basic for the DuinoMite, with the 12 pin GPIO limitation.

All you need to do is to update the firmware version from the factory version, to the latest MMBasic version for the DuinoMite, and use the Silicon Chip serial drivers.

DuinoMite Firmware Update Guide:
http://www.duinomite.com/duinomite-firmware-update-guide/

Geoff Graham's MaxiMite Page (for all documentation, manuals etc.)
http://geoffg.net/maximite.html
 
Geoff Graham's MaxiMite Download Page (for all files)

http://geoffg.net/Downloads/Maximite/

MaxiMite "The Back Shed" Support Forum:
http://www.thebackshed.com/forum/forum_topics.asp?FID=16&PN=1

All of these Dontronics DuinoMite Products can all be converted to 12 Pin MaxiMites:
http://www.dontronics-shop.com/olimex-duinomite-mini.html
http://www.dontronics-shop.com/olimex-duinomite.html
http://www.dontronics-shop.com/olimex-duinomite-mega.html

All Dontronics MaxiMite-DuinoMite Products:
http://www.dontronics-shop.com/the-maximite-computer.html

The original DuinoMite firmware still needs some work done on it before it can be considered stable.

It was initially designed to support the Arduino Shield footprint. The DuinoMite firmware uses the PIC32s internal peripherals for UART, SPI etc. and also adds a UEXT connector for another range of add-on peripherals.

If and when the DuinoMite firmware reaches a point where it covers your specific application, it is very easy to upgrade to the latest DuinoMite version, so you can test it as a DuinoMite. It is also very easy to roll back to make it a 12 Pin MaxiMite.

Please Note:

The DuinoMite uses the PIC32s internal peripherals for UART, SPI etc.

By setting this product up as a MaxiMite, you will lose the DuinoMite features, such as the software drivers that support the Olimex UEXT connector, and the real UARTs, as all of your UARTs will be bit banged in MaxiMite Mode.

 

The above table was provided by: Andrew Rich VK4TEC

Support:

MaxiMite "The Back Shed" Support Forum:
http://www.thebackshed.com/forum/forum_topics.asp?FID=16&PN=1

  1. Do you need additional support on this product?

  2. You can't find the information you need in the documentation?

  3. You wish to know what is included in the package?

  4. The download links on this product page aren't working correctly?

  5. Any questions not covered in the above list?

Then please click here.

A DuinoMite specific support Forum is also available at Ken Segler Designs.

The DuinoMite Newsletter Subscription page is at:
http://www.dontronics-shop.com/mailing-list-dontronics-newsletter.html
This will keep you up to date with DuinoMite Firmware and other News

 Back To Top
Posted in News | Tagged , , , | Leave a comment

DuinoMite: Magnetic Fileds with MOD-MAG

Magnetic Fileds with MOD-MAG

 

Unread postby ThierryP » Wed Mar 28, 2012 9:16 am

Hi,
I recently added a MOD-MAG UEXT Module [2] to my Duinomite Mega and want to share the first experiences and code on this forum.
Starting point was the example code in [1], which I adapted and extended to suit my need: to measure the rotations of my provider’s bellow/valve type natural gas meter by detecting tiny fluctuations in it’s emitted magnetic field, which are way too small to trigger even a sensitive Hall effect sensor (A3214EUA-T), let alone a reed relais: these magnetic fluctuations are smaller or in the same order of magnitude as the Earth’s magnetic static field [3].
I've stripped this program from it's specific gas-measurement and noise reduction, added some comments for readability and list it here below:

 

 

Code: Select all
100 OPTION BASE 0
110 MAG_PACE = 50 'pause between readings (ms)
135    'Following values to be set by user
136    'The program provides estimates for these offsets
137    '   (twist and turn MOD-MAG in every direction)
140 X_OFFSET= 3282 : X_SCALE=0.1
150 Y_OFFSET=-2183 : Y_SCALE=0.1
160 Z_OFFSET=-2670 : Z_SCALE=0.1
161 X_LASTR=359:YLASTR=311
165    'Init Max, Min Values X,Y,Z. to measure new Offset
240 X_MAX=-10000:Y_MAX=-10000:Z_MAX=-10000
250 X_MIN=10000:Y_MIN=10000:Z_MIN=10000
251    'Variables and Init for the MOD-MAG
255 ID = 0: DIM AXES(6) 
260 I2CEN 100,100
270 I2CRCV &H0E, 0, 1, ID, 1, 7
280 I2CSEND &H0E, 1, 2, &H11, &H80
290 I2CSEND &H0E, 0, 2, &H10, &H01
295    'Main loop clears the screen and redraws from scratch
300 CLS
320 PRINT "Current OFFSET: ",X_OFFSET,Y_OFFSET,Z_OFFSET
330 PRINT "Measured Mean : ",INT(X_MAX/2+X_MIN/2),INT(Y_MAX/2+Y_MIN/2),INT(Z_MAX/2+Z_MIN/2)
350 X_LASTP=181:Y_LASTP=281:ZL_LASTP=381
355    'Draw the Axes and Circles as reference
360 LINE (0,131)-(239,131):LINE -(0,131)
370 LINE -(0,181):LINE -(  5,181):LINE -(0,181)
380 LINE -(0,231):LINE -(239,231):LINE -(0,231)
390 LINE -(0,281):LINE -(  5,281):LINE -(0,281)
400 LINE -(0,331):LINE -(239,331):LINE -(0,331)
410 LINE -(0,381):LINE -(  5,381):LINE -(0,381)
420 LINE -(0,431):LINE -(239,431):LINE -(239,131)
430 CIRCLE (359,311),120
440 CIRCLE (359,311),3
450 LINE (239,311)-(479,311)
460 LINE (359,431)-(359,191)
470    'Subloop doing 240 measurements and plot them linear and circular
550 FOR n=0 TO 239
560 I2CRCV &H0E, 0, 6, AXES(0), 1, 1
565    'Convert results from two-complements binary format
570 FOR i=0 TO 5 STEP 2
580   IF AXES(i)<128 THEN 600
590   AXES(i) = -(256-AXES(i))
600 NEXT i
610 X=AXES(0)*256+AXES(1)
620 Y=AXES(2)*256+AXES(3)
630 Z=AXES(4)*256+AXES(5)
742    'XYZ values are still raw measurements, ie incl offset
743    ' Measure Min-Max XYZ values
750 IF X>X_MAX THEN X_MAX=X
760 IF X<X_MIN THEN X_MIN=X
770 IF Y>Y_MAX THEN Y_MAX=Y
780 IF Y<Y_MIN THEN Y_MIN=Y
790 IF Z>Z_MAX THEN Z_MAX=Z
800 IF Z<Z_MIN THEN Z_MIN=Z
805     'Now the XYZ values can be Offset and Scaled
810 X=(X-X_OFFSET)*X_SCALE
820 Y=(Y-Y_OFFSET)*Y_SCALE
830 Z=(Z-Z_OFFSET)*Z_SCALE
1120 XP=X+181
1130 YP=Y+281
1140 ZP=Z+381
1150 XR=359-X*2
1160 YR=311+Y*2
1170 LINE (n,X_LASTP)-(n+1,XP)
1180 LINE (n,Y_LASTP)-(n+1,YP)
1190 LINE (n,Z_LASTP)-(n+1,ZP)
1200 LINE (X_LASTR,Y_LASTR)-(XR,YR)
1210 X_LASTP=XP:Y_LASTP=YP:Z_LASTP=ZP
1220 X_LASTR=XR:Y_LASTR=YR
1240 PAUSE MAG_PACE
1250 NEXT n
1260 GOTO 300

It's measures and plots the 3 magnetic axes measured in real time on a connected VGA monitor, refreshing the screen every 12 seconds with the current value of MAG_PACE=50 (ms).
It applies an Offset for X, Y, and Z that must be set and that is big compared to the fluctuations measured. It also averages the Max and Min XYZ values so that better values for the offset can be found.
Don't measure close to large pieces of metal, eg iron supports under my desk complete bring the values off-scale, preferably in mid-air. Here's a sample plot where I turned the MOD-MAG around:
Image
As opposed to what is stated in [1] noisy fluctuations were very small and if the scale factors are set correctly the XY plot will stay neatly within the circle, as expected.
Here's another plot where I tried to hold the device in stable position for ~12s.
When fixed on the gasmeter, the Offset could was stable for more than a week without changing more than 3 digits, ie ~0,3uT
Image
Links:
[1]: http://olimex.wordpress.com/2012/01/26/duinomite-project-measuring-earths-magnetic-field-with-mag3110/
[2]: http://olimex.com/dev/mod-mag.html
[3]: http://forum.jeelabs.net/comment/6623#comment-6623

 

Posted in Applications | Tagged , , | Leave a comment

How to use GPS with DuinoMite

How to use GPS with DuinoMite

Updated 28-March-2012:
Andrew Rich VK4TEC did his version of this application, and the thread and Video are now posted.
 

Image

This article is publishing with the help of my friend Mick Gulovsen who edited it and helped me translating it from it’s original Bulgarian-English to Queen’s English :)

 

Global Positioning System (GPS) is a satellite based global navigation system that provides location and time information in all weather, anywhere on (or near) Earth, where there is an unobstructed line of sight to four or more GPS satellites.

You can read more about how GPS was created and how it works in Wikipedia.

Also some theory is available in this web site: http://lea.hamradio.si/~s53mv/navsats/theory.html.

It’s very easy to use GPS with DuinoMite using Olimex’s UEXT GPS module ‘MOD-GPS’ which interfaces using DuinoMite’s UEXT connector.

MOD-GPS is based on the SiRF StarIII chipset which provides high precision, low power and high sensitivity, so MOD-GPS is even able to lock onto satellites inside buildings.

MOD-GPS output is via serial 19200 bps 8bits,1 stop bit, No Parity.

It is easy to access MOD-GPS data with DuinoMite using MMBasic, for example, you can view MODGPS output using this small program:

10 OPEN “COM3:19200″ AS #5
20 PRINT INPUT$(1,#5);
30 GOTO 20

Running this code will generate something like this:

$GPRMC,192157.110,A,4208.3427,N,02445.0243,E,0.13,92.58,211111,,,A*5E
$GPGGA,192158.110,4208.3427,N,02445.0243,E,1,03,2.2,134.8,M,37.1,M,,0000*5C
$GPGSA,A,2,07,23,20,,,,,,,,,,2.5,2.2,1.0*31
$GPRMC,192158.110,A,4208.3427,N,02445.0243,E,0.11,83.24,211111,,,A*58
$GPGGA,192159.110,4208.3428,N,02445.0242,E,1,03,2.2,134.8,M,37.1,M,,0000*53
$GPGSA,A,2,07,23,20,,,,,,,,,,2.5,2.2,1.0*31
$GPGSV,3,1,12,23,63,042,38,20,38,124,35,07,38,197,39,13,72,313,24*70
$GPGSV,3,2,12,04,43,277,22,10,35,306,25,16,20,087,,02,16,316,24*72
$GPGSV,3,3,12,32,14,118,20,30,14,047,,08,10,203,24,01,01,169,*71
$GPRMC,192159.110,A,4208.3428,N,02445.0242,E,0.10,84.84,211111,,,A*5B

This will continue forever, each message starts with $Gpxxx then some data separated with “,” and ends with *xx which is the checksum in Hex.

Some messages contain several ,,, i.e. empty parameters.

When the GPS receiver is started for the very first time or after it was moved any distance without being powered the GPS receiver will have lost connection to some satellites, it takes time to lock onto them again (called `cold start time’ and is usually about 1 minute).

If you are inside a building or the signal is weak due to other obstacles the GPS receiver may not lock to some satellites at all, MOD-GPS can lock onto 12 satellites, but even 4 are enough to calculate it’s correct location.

There are 4 types of messages which MOD-GPS sends:

$GPGGA,192839.000,4208.3343,N,02445.0342,E,1,07,1.5,171.8,M,37.1,M,,0000*56
$GPGSA,A,3,07,23,20,10,13,08,04,,,,,,3.1,1.5,2.7*3A
$GPGSV,3,1,11,13,72,323,37,23,61,046,34,04,43,273,20,07,41,198,37*78
$GPGSV,3,2,11,10,38,307,30,20,35,126,24,16,21,084,25,02,18,314,22*70
$GPGSV,3,3,11,30,13,044,18,08,12,203,36,32,12,119,19*4D
$GPRMC,192840.000,A,4208.3343,N,02445.0342,E,0.00,37.14,211111,,,A*51

These messages are in NMEA0183 format and the prefix $GP means that the message is ordinated from the GPS receiver.

http://www.gpsinformation.org/dale/nmea.htm has an explanation of the different NMEA messages.

 

RMC – Recommended Minimum Essential GPS Data.

$GPRMC,192840.000,A,4208.3343,N,02445.0342,E,0.00,37.14,211111,,,A*51

let’s decode our message:

$GPRMC – message ID
192840.000 – 19:28:40 UTC time stamp
A – Status A=active or V=Void
4208.3343,N – Plovdiv Latitude 42 deg 08.3343′ N
02445.0342,E – Longitude 24 deg 45.0342′ E
0.00 – Speed over the ground in knots
37.14 – Track angle in degrees True
211111 – Date – 11th of November 2011
(empty field) – Magnetic Variation
(empty field) – Magnetic Variation direction
*51 – The checksum data, always begins with *

With this message we get information about time, date, our location and our speed, the speed is calculated very precisely and you can even calibrate your car or motorcycle speedometer with the value read by the GPS, as the car’s mechanical speedometers usually have about +-5% error.

This immediately leads me to an interesting project: Car performance logger. Having the change of speed of your car and the time, you can calculate the acceleration, and if you know the weight of your car you can also calculate the moment power as P=A*m i.e. you can monitor and log exactly how much horsepower or kw are used when your car accelerates.

GGA – Essential 3D Location Fix Data.

Let’s decode our message:

$GPGGA,192839.000,4208.3343,N,02445.0342,E,1,07,1.5,171.8,M,37.1,M,,0000*56
$GPGGA – Global Positioning System Fix Data
192839.000 – Fix taken at 19:28:39 UTC
4208.3343,N – Latitude 42 deg 08.3343′ N
02445.0342,E – Longitude 24 deg 45.0342′ E
1 – Fix quality: 0 = invalid
1 = GPS fix (SPS)
2 = DGPS fix
3 = PPS fix
4 = Real Time Kinematic
5 = Float RTK
6 = estimated (dead reckoning) (2.3 feature)
7 = Manual input mode
8 = Simulation mode
07 – Number of satellites being tracked
1.5 – Horizontal dilution of position
171.8,M – Altitude, Meters, above mean sea level
37.1,M -Height of geoid (mean sea level) above WGS84 ellipsoid
(empty field) – time in seconds since last DGPS update
(empty field) – DGPS station ID number
*56 – the checksum data, always begins with *

GSA – GPS DOP and active satellites.

This sentence provides details on the nature of the fix. It includes the number of the satellites being used in the current fix and the DOP.
DOP (dilution of precision) is an indication of the effect of satellite geometry on the accuracy of the fix.
It is a unit-less number where smaller is better. For 3D fixes using 4 satellites a 1.0 would be considered to be a perfect number, however for multi-satellite fixes it is possible to see numbers below 1.0. There are differences in the way the PRN’s (Pseudorandom Noise) are presented which can affect the ability of some programs to display this data. For example, in the example shown below there are 5 satellites in the solution and the null fields are scattered indicating that the almanac would show satellites in the null positions that are not being used as part of this solution. Other receivers might output all of the satellites used at the beginning of the sentence with the null fields stacked up at the end.
This difference accounts for some satellite display programs sometimes, not being able to display the satellites being tracked. Some units may show all satellites that have ephemeris data without regard to their use as part of the solution but this is non-standard.

$GPGSA,A,3,07,23,20,10,13,08,04,,,,,,3.1,1.5,2.7*3A

let’s decode our message :

$GPGSA – Satellite status message
A – Auto selection of 2D or 3D fix (M = manual)
3 – 3D fix – values include: 1 = no fix
2 = 2D fix
3 = 3D fix
07,23,20,10,13,08,04 – PRNs of satellites used for fix (space for 12)
3.1 – PDOP (dilution of precision)
1.5 – Horizontal dilution of precision (HDOP)
2.7 – Vertical dilution of precision (VDOP)
*3A – the checksum data, always begins with *

GSV – Satellites in View

Shows data about the satellites that the unit might be able to find based on its viewing mask and almanac data. It also shows current ability to track this data. Note that one GSV sentence only can provide data for up to 4 satellites and thus there may need to be 3 sentences for the full information.
It is reasonable for the GSV sentence to contain more satellites than GGA might indicate since GSV may include satellites that are not used as part of the solution. It is not a requirement that the GSV sentences appear in sequence.
To avoid overloading the data bandwidth some receivers may place the various sentences in different samples since each sentence identifies which one it is.
The field called SNR (Signal to Noise Ratio) in the NMEA standard is often referred to as signal strength. SNR is an indirect but more useful value than raw signal strength.
It can range from 0 to 99 and has units of dB according to the NMEA standard, but the various manufacturers send different ranges of numbers with different starting numbers so the values themselves cannot necessarily be used to evaluate different units.
The range of working values in a given GPS will usually show a difference of about 25 to 35 between the lowest and highest values, however 0 is a special case and may be shown on satellites that are in view but not being tracked.

$GPGSV,3,1,11,13,72,323,37,23,61,046,34,04,43,273,20,07,41,198,37*78
$GPGSV,3,2,11,10,38,307,30,20,35,126,24,16,21,084,25,02,18,314,22*70
$GPGSV,3,3,11,30,13,044,18,08,12,203,36,32,12,119,19*4D

$GPGSV – Satellites in view
3 – Number of sentences for full data
1 – sentence 1 of 3
11 – Number of satellites in view
13,72,323,37
13 – Satellite PRN number
72 – Elevation, degrees
323 – Azimuth, degrees
37 – SNR – higher is better
(for up to 4 satellites per sentence)
*78 – the checksum data, always begins with *
The three messages contain the info for all 12 satellites.

Example:

The following code reads RMC message and extract the time, date, latitude, longitude

10 CLS
20 PRINT “GPS DEMO CODE”
30 OPEN “COM3:19200″ AS #5 ‘open UEXT UART at COM3
40 IF NOT EOF(#5) THEN 60 ‘if something is received
50 GOTO 40
60 C$=INPUT$(1,#5) ‘get character
70 IF C$ = CHR$(10) THEN 100 ‘until LF is received
80 MSG$=MSG$+C$ ‘store in MSG$
90 GOTO 40
100 ‘LOCATE 0,100: ? MSG$ ‘used for debug
110 IF LEFT$(MSG$,6) = “$GPRMC” THEN 140 ‘wait for RMC message
120 MSG$=”"
130 GOTO 40
140 LOCATE 0,100: PRINT MSG$ ‘RMC message received
150 LOCATE 0,20: PRINT “UTC TIME: “;
160 A$ = MID$(MSG$,INSTR(MSG$,”,”)+1)
170 PRINT MID$(A$,1,2);”:”;MID$(A$,3,2);”.”;MID$(A$,5,2)
180 GOSUB 500
190 GOSUB 500
200 LATITUDE$ = LEFT$(A$,INSTR(A$,”,”)-1)
210 LOCATE 0,50: PRINT “LATITUDE :”;LATITUDE$;” “;
220 GOSUB 500
230 NS$ = LEFT$(A$,1)
240 PRINT NS$
250 GOSUB 500
260 LONGITUDE$ = LEFT$(A$,INSTR(A$,”,”)-1)
270 LOCATE 0,60: PRINT “LONGITUDE :”;LONGITUDE$;” “;
280 GOSUB 500
290 EW$ = LEFT$(A$,1)
300 PRINT EW$
310 GOSUB 500
320 SP$ = LEFT$(A$,INSTR(A$,”,”)-1)
330 LOCATE 0,70: PRINT “SPEED KNTS:”;VAL(SP$)
340 GOSUB 500
330 GOSUB 500
340 LOCATE 0,30: PRINT “UTC DATE: “;
350 PRINT MID$(A$,1,2);”-”;MID$(A$,3,2);”-20″;MID$(A$,5,2)
360 GOTO 120
500 A$ = MID$(A$,INSTR(A$,”,”)+1) ‘skip to next ‘,’
510 RETURN

Posted in Applications | Tagged , , , | 2 Comments

DuinoMite, the World’s cheapest computer.

DuinoMite, the World's cheapest computer.

By Don McKenzie.

Prices start at around $30, just add PS2 keyboard, VGA Monitor, or TV. Runs BASIC language, or C. Save programs to uSD card, or internal flash memory. Or simply run via a terminal program from any PC. Arduino Shield foot print on many boards.

INTRODUCTION:

DuinoMite is a MaxiMite Compatible Basic computer, originally designed by Geoff Graham, with additional features and Arduino shield like layout. DuinoMite allows you to program in the BASIC language and have VGA and Keyboard interface, so you can develop and write your code in Basic without the need of any computer. You can store your code on the SD-CARD and execute it on power up though autoexec.bas main code. BASIC programs can easily be exchanged and saved to a PC using either a terminal program and a USB connection, or the SD card. An internal flash memory drive can also be used to save up to 256K of programs and files. Development can be done on the USB only connection. Fantastic user support via a very active user forum group.

MODES OF OPERATION:

MODE 1 Stand Alone:

Run as a PC, by attaching a VGA monitor, or TV, and a PS2 Keyboard. Save files to the SD card, or the internal flash drive.

MODE 2 Terminal Mode from a PC:

Use any computer that supports a USB port, and a Terminal program, and you can run BASIC Programs, and develop directly from your computer. Save files to the SD card, the internal flash drive, or your PC.

MODE 3 Any combination of the above:

You can run two keyboards, and two screens in parallel, or remove any single item, and the unit will still operate. If you are running the standard DuinoMite board as a controller, and you don't need a keyboard, or screen, you can disconnect the IO board completely.

FEATURES: (Check individual boards for correct specifications as not all boards have all features.)

  • PIC32MX795 microcontroller
  • micro SD card
  • USB OTG which allow it to act both as Host and Device, so it can accept Android ADK, Printers, Cameras, Keyboards, Mouses, etc USB devices.
  • VGA connector
  • Composite Video connector
  • CAN driver and connector
  • RS232 driver and connector
  • two UEXT connectors allowing Olimex modules to be connected one inside the box one outside the box
  • PS-2 keyboard
  • Audio output connector
  • Arduino like format i.e. can work with Arduino shields

DuinoMite, the MaxiMite Compatible
There are three new boards being produced by Olimex. Because of the re-mapping of the schematic, we have had to get software assistance with a new boot loader and get the existing MM-Basic firmware patched to match. I chose Ken Segler, (http://www.kenseglerdesigns.com) a Back Shed Forum regular, to carry out this task, as Ken has shown his proficiency with porting the MaxiMite code to other platforms, as well as adding many new routines to MM-Basic.

 

New Boards:
Schematics and all other relevant files are available from:

http://www.duinomite.com/files/index.php?dir=Hardware%2FDontronics%2FOlimex%2F

 

DuinoMite-Mega:

http://www.dontronics-shop.com/olimex-duinomite-mega.html

This fits nicely into a plastic box 130mm x 100mm x 30mm.
The box will be laser cut to allow easy fitting.
Arduino footprint can be seen in the middle of the board, however to make use of this, you would need to remove the cover, or remove the board fully from the case. An external shield adapter board will be available, and is listed below.

DuinoMite Board:

http://www.dontronics-shop.com/olimex-duinomite.html

DuinoMite-I/O Board:

http://www.dontronics-shop.com/olimex-duinomite-io-board.html

This will be two boards that plug into each other with a small IDC flat ribbon cable. It was felt that the VGA and Keyboard connectors could interfere with any shields being added, because of the height of these connectors. It would also allow the board to be more readily used as a stand alone microcontroller without the extra connectors, if the user chose to do this.

Connector to the left of the DuinoMite board, is for the I/O board, and the one to the right is the UEXT Connector. More on this later.

DuinoMite-Mini Board:

http://www.dontronics-shop.com/olimex-duinomite-mini.html

This is without the Arduino shield and is built as a minimum low cost system, yet it will still run as a full Maximite Computer as both Keyboard and VGA connectors are installed on the front edge of the board. This board is 64mm x 50m

DuinoMite-Shield Board:

http://www.dontronics-shop.com/olimex-duinomite-shield-board.html

Can be used on either the DuinoMite-Mega, or the DuinoMite-Mini boards, to add the Arduino footprint to the 26 pin IDC header via a flat ribbon cable.

NOTE **** Shield Adapter Boards:
Dontronics DonDuino Cross was designed for the Maximite, however it will also work on the DuinoMite.
DuinoMite-Shield Board was designed for the for the DuinoMite range from Olimex,
however it will also work on the MaxiMite.

DuinoMite Features:

These features will vary with board type, and possibly there will be various levels of component population, so that users may be able to order boards at reduced costs. Again, to be determined.

Standard features:

- USB
- VGA
- PS/2
- SD card
- GPIO 26 pin connector
- Audio connector
- Composite video connector
- User button, Reset button
- Two LEDs

Possible Additional Features:
(May not be fitted to all boards)

- Arduino connector with compatibe port arrangement i.e. SPI, I2C etc connected on proper pins to make maximal compatibility with Arduino shields
- Real Time Clock with battery backup
- RS232 connector and driver as host i.e. male DB9 connector as on PC
- CAN will open industrial and automotive applications
- USB-OTG functionality i.e. USB host/USB device, this is not so expensive but I think it important to have as will allow this board to be used as Android ADK as well, if you do not know what is this, it's easy way to interface Android tablets and phones, here is demo on Microchip site http://www.microchip.com/microchip.webcontent.provider/Video.aspx?id=HXhgJvFQ6v8
- DC/DC power supply to allow wide range 9-30V input power supply adapters to be used
- Li-polimer charger and battery connector, this will allow the board to work with Li-Po batteries
- UEXT enables WiFi, Zigbee, Ethernet, RELAY-IO, RFID etc modules to be connected
- Ethernet on board will just rise the cost, once we have UEXT we can connect MOD-ENC28J60 or MOD-WIFI to implement internet /ethernet connectivity.

NOTE ****
UEXT Connector is available on all boards.

Please Note:

Dontronics ships world wide at a current cost of around $12USD internationally for all packages. As an Australian company, we have no mechanism to charge VAT or any state taxes. As most items are low value, customs usually allows these items through. You will generally find our prices cheaper than places like Element14 (Farnell) and Mouser. Order today, we ship tomorrow. In business since 1964, and on email 365 days a year.

Firmware Alternatives:

How about a 12 pin GPIO DuinoMite that is a 100% hardware compatible MaxiMite?

DuinoMite hardware is now supported by Geoff Graham, the MaxiMite designer. Please note that this is limited hardware support, in as much as only 12 of the 20 IDC GPIOs are supported by Geoff's firmware, which is to be expected.

But it does give you a 12 pin GPIO Maximite at a third of the price.

It takes only a few minutes to do a firmware change from the DuinoMite hex file, to the MaxiMite hex file, and just as easy to roll it back into a DuinoMite, if you choose to do so. This means you can build it into what you want very quickly and easily, so you can choose the features you want.

This new MaxiMite version for the DuinoMite  is available for download from: http://geoffg.net/maximite.html#Downloads
Our thanks to Geoff Graham for making this available.

Wish to program the DuinoMite in C?

Olimex Pinguino IDE supports the DuinoMite even now. No need for a special linker script as there is one for the 795 already. Use the existing bootloader that is programmed into the board.
Tsvetan of Olimex.

The World's First Arduino Computer
I believe the DuinoMite-Mega version is the correct model to call "The World's First Arduino Computer", as it is not only boxed, but is a complete computer system in the true sense of the word. OK, you can't get to the Arduino footprint without an adapter, or taking the top cover off, but the shield footprint is there for users, if they choose to go this way.

But I know there will still be the knockers that will spin the facts around, and say otherwise. :-)

If one of these boards doesn't cover the definition of "Arduino and Computer", then nothing ever will.

And there may well be a user application that needs perhaps the CAN feature, as well as an off the shelf Arduino shield, so they may fit it all into a new case, or not even have a case at all.

Already the Maximite has been adapted to run TRS-80 Basic, as well as Unix, and there is no reason why it can't be used for C language development, the same as the Pinquino board has done in the past.

TRS-80 Model I, level II on a PIC32 See:
http://kenseglerdesigns.com/cms/sites/default/files/trs-80.jpg
for the thread:
http://www.thebackshed.com/forum/forum_posts.asp?TID=3937&PN=1

Maximite Computer now running Unix, 2.11BSD. Thread at:
http://www.thebackshed.com/forum/forum_posts.asp?TID=3925&PN=1

 

Posted in News | Tagged , , , , | Leave a comment

DuinoMite, the Maximite Compatible. The World’s First Arduino Computer.

DuinoMite, the Maximite Compatible. The World's First Arduino Computer.
By Don McKenzie. Dontronics.com

An Open Source Hardware Project. (OSHW)

In the Arduino movie documentary: http://arduinothedocumentary.org/

The question is posed, "At least one Arduino Computer, Why Not?"

The Italian Arduino project was initially based on an AVR micro,
(early history states PIC was first used, see: http://www.thebackshed.com/forum/forum_posts.asp?TID=3926&PN=1)
and the "C" language. Because of the success of the platform, it recently migrated across to Microchip's PICmicro hardware originally based on the 18F2550, and called Pinguino. See: http://www.hackinglab.org/pinguino/index_pinguino.html

This has now moved onto PIC32 micros, and boards have recently been manufactured by Olimex in Bulgaria. see: http://www.olimex.com/dev/pic32-pinguino.html

Many other PICmicro Arduino type boards have also appeared. I apologize for not covering them all in this small introduction.

Now for the strange twist, to move it onto what you could possibly call a computer system.

An Australian by the name of Geoff Graham, has come up with a small computer system based on the PIC32MX695F512H. The PIC32MX795F512H (with CAN) can also be used. This is called The Maximite Computer, and has been reasonably successful in Australia, however is basically unknown to the rest of the world.

This computer system uses BASIC, not "C", in fact BASIC very much like the old TRS-80 and Commodore computers of 30+ years ago.

This is a portion of Geoff's description from his Maximite project page at: http://geoffg.net/maximite.html

The Maximite is a small and versatile computer running a full featured BASIC interpreter with 128K of working memory.

It will work with a standard VGA monitor and PC compatible keyboard and because the Maximite has its own built in SD memory card and BASIC language you need nothing more to start writing and running BASIC programs.

The Maximite also has 20 input/output lines which can be independently configured as analog inputs, digital inputs or digital outputs. You can measure voltage, frequencies, detect switch closure, etc and respond by turning on lights, closing relays, etc – all under control of your BASIC program.

The design is free and open source including the software and BASIC interpreter. And all this is powered by a single chip which costs just US$8.44

Geoff's design allows you to run this computer system as a stand alone unit with local VGA and keyboard, or via a USB connection to any computer system that supports USB and a terminal program. You can use either, or both at the same time.

What makes this computer (or Micro-Controller) unique is that you power it up. You don't need to load any software, and write a simple program like PRINT "Hello World" in BASIC. You can control the 20 input output pins very simply just setting them high, or low, or reading them in. You don't have to learn "C". When your simple program is written, you can save the basic text program to an SD card, that can be read and saved on your PC. Support Forum is extremely active.

And why not have the ability to program all of the Arduino shields in BASIC? It is only software, and it will be generated by users eventually.

I was adapting the Maximite design as best I could to the Arduino shield platform, so we could take advantage of the many available shields, but it became apparent to many people that the Olimex PIC32 Pinguino board, was very close to what was required for a Maximite Arduino Computer.

Olimex and Dontronics have gathered a small team together to match the Maximite software and hardware to the Pinguino platform.

This is a Maximite compatible product, however there is no official support, apart from the Help Forum members.

Let me point out that I am just a customer, and this will be an Olimex board, not a Dontronics board, so it will be available for everyone.

We are going over the final details now, and it is almost design by committee, so it is very awkward to pin everything down.

It goes from a basic Maximite circuit, right up to a fully populated PIC32 do everything board.

But this isn't possible of course, on something the size of an Arduino footprint, so there will be trade offs.

What we must have:
Arduino connector with compatible port arrangement i.e. SPI, I2C etc connected on proper pins to make maximal compatibility with Arduino shields.

Plus:
- USB
- VGA
- PS/2
- microSD card
- Audio connector
- Composite video connector
- user button, reset button
- two LEDs

An I/O satellite board with audio, video, VGA, and Keyboard sockets, will attach via a 10 pin IDC connector. This is the 10 pin header on the left of the above picture.

And there may be a whole host of features added that are much the same as the Olimex Pinquino boards. If these aren't added initially, they may be allowed for in the artwork so that they can be populated to different levels, and possibly ordered with the required level to suit the end user.

The standard Olimex UEXT header allows for WiFi, Zigbee, Ethernet, RELAY-IO, RFID etc modules to be connected. This is the header on the right hand side.

Ethernet on board will just raise the cost. Once we have the UEXT header, we can connect MOD-ENC28J60 or MOD-WIFI to implement internet /ethernet connectivity.

PLEASE NOTE ***

Possibly none of these enhancements over the standard Maximite features, will be supported in the official MM-Basic, but there is the possibility they will be included by other users, such is the beauty of Open Source hardware and Software, we cannot expect support to be offered on this board from Geoff Graham

Eventually of course, anything can, and will happen. I know it will be user driven.

I could list the features that may be added. It is really mind boggling, but to be fair, I should only mention the items that we are 100% certain of at this point.

And I know it will be a great board for C programmers also. They should also be able to make use of the VGA and keyboard connectors with suitable drivers.

FAQ:

Q) When will it happen?
A) Approx. October 2011.

Q) Will the 20 I/O pins be different to the currently produced Maximites?
A) Yes, as there is no other way of arranging the Arduino shields to be as compatible as possible on a PIC32 Micro, apart from re-assigning the current pins.
Geoff Graham, will support the original Maximite I/O configuration, into the foreseeable future. But of course the firmware will take the pin changes into account and will work as a maximite and run all of the current software without change.

Q) Is there any software support for the Olimex Maximite Compatible Board?
A) No. However Help Forum members should be able to assist on most occasions.

All of Dontronics current Maximite products can be seen at:
http://www.dontronics-shop.com/the-maximite-computer.html

A dedicated blog can be found at: http://www.duinomite.com/

On Line support from the designer and other Forum members: http://www.thebackshed.com/forum/forum_topics.asp?FID=16&PN=1
 

Posted in News | Tagged , , , , | Leave a comment

DuinoMite: Web server using Roving Networks RN-XV. Suports dynamic page

Full article at: Web server using Roving Networks RN-XV. Suports dynamic page

Unread postby bmjbmj » Sat Mar 03, 2012 11:53 pm

XVWWW (Beta)

 

I have finally found time to complete my web-server project. This server is capable to:

  • Connects wireless to the network using Roving Networks RN-XV (about 34.95 $US from Sparkfun)
  • Server one arbitrary complex page from disk A: or B:
  • Read in an process POST data from the client (eg. to 'turn on' a pin)
  • Inject java-script variables in to the served page by fly. The java-script in the page (if any) can use the values at choice.
  • Send a 404 page if asked for other page than '/'
  • Outputs a log to the screen

I have tested the server using FireFox 10.0.2 and intend to test it with more browsers soon.

To use the program save it and the two attached htm-files to the '/' (root) of B: driver . Configure the RN-XV for your network (using a terminal on your PC) but do NOT use the auto-join feature of the RN-XV. Run xvwww.bas. The demo page just receives values from the text-boxes and sets the gauges accordingly. To do something more useful add your own code in gosubs 8000 and 9000 to preform I/O on some pins on the yC (e.g measure a voltage and activate a LED).

The code at the bottom of this page is current as of this posting but I intend to post bug-fixes and new features on Google Code at http://code.google.com/p/xvwww/

ToDo to next version

  • Change the use of PAUSE to a real ACK handle
  • Fix the flush routine.
  • General cleanup of code
  • Test more browsers

Greetings B Mathias Johansson

webpage.png
Example of a served page
webpage.png (79.11 KiB) Viewed 3 times

 

1.jpg
Example of the log
1.jpg (20.8 KiB) Viewed 3 times

 

2.jpg
Example of the log
2.jpg (14 KiB) Viewed 3 times

xvwww.bas

Code: Select all
5 REM "Copy Left by B Mathias Johansson. (bmjbmj@telia.com)"
10 REM "RN-XV based WWW server"
15 reqTimeOut=3001:REM "Time out for req. header in ms"
16 DIM VARS$(2,10)
20 OPEN "COM3:115200, 1024" AS #1":REM "Open UEXT. Set TO your port""
30 GOSUB 1000:REM "Init RV-XV"
40 GOSUB 2000:REM "Join network"
100 REM "Main loop"
110 DO
120 PRINT #1,"exit":REM "Exit if we haven't already"
130 PAUSE 500
140 GOSUB 3000
160 timeout=0:reqtyp$="":err=0:REM"clear vars for gosubs"
170 GOSUB 7000:REM "Pars header"
180 PRINT"Err:";:PRINT timeout;:PRINT" ";:PRINT reqtype$;:PRINT err
190 IF timeout=1 THEN GOTO 240:REM "Close and reset"
200 IF err>0 THEN
205 page$="404.htm":REM "Send page not found"
210 GOSUB 6000
220 ELSE
225 page$="index.htm":REM "Send page"
230 GOSUB 6000
235 ENDIF
240 REM "Enter comand mode and close connection to client"
250 PAUSE 500
260 PRINT #1,"$$$";
265 PAUSE 500
270 PRINT #1,"close"
280 PAUSE 1000
290 PRINT #1,"exit"
300 PAUSE 500
310 GOSUB 3000
320 PRINT "Conetion closed"
998 LOOP
999 END
1000 REM "Init RV-XV to known state"
1005 REM "Exit comand mode if we haven't"
1010 PRINT #1,""
1020 PRINT #1,"exit"
1030 PAUSE 500
1040 REM "Enter comand mode"
1050 PRINT #1,"$$$";
1060 PAUSE 500
1065 in$=INPUT$(200,#1)
1066 PRINT in$
1070 REM "Reboote device into known state
1080 PRINT #1,"reboot"
1090 PAUSE 3000
1100 in$=INPUT$(200,#1)
1110 PRINT in$
1999 RETURN
2000 REM "Join the PREPROGRAMED network. Do not forget to configure the RV-XV!"
2004 REM "Enter comand mode"
2005 PAUSE 500
2010 PRINT #1,"$$$";
2020 PAUSE 500
2030 PRINT #1,"set comm remote 0":REM "No auto msg."
2031 PAUSE 500
2032 PRINT #1,"set comm open 0"
2033 PAUSE 500
2034 PRINT #1,"set comm close 0"
2035 PAUSE 500
2036 PRINT #1,"set comm idle 2":REM "Timeout link in 2s"
2040 PAUSE 500
2050 PRINT #1,"join":REM "Try to join"
2055 PAUSE 3000
2060 in$=INPUT$(255,#1)
2065 PRINT in$
2100 in$=INPUT$(255,#1)
2110 PRINT in$
2999 RETURN
3000 REM "Flush RX"
3005 REM "UGLY!!!! FIX THIS!!!!"
3006 REM PRINT "Debug av flush"
3010 in$=INPUT$(255,#1)
3015 REM PRINT in$;
3020 in$=INPUT$(255,#1)
3025 REM PRINT in$;
3030 in$=INPUT$(255,#1)
3035 REM PRINT in$;
3040 in$=INPUT$(255,#1)
3045 REM PRINT in$
3050 REM PRINT "end debug av flush"
3999 RETURN
4000 REM "Pars header for POST"
4999 RETURN
5000 REM "Set javascript variabels"
5999 RETURN
6000 REM "Send HTML"
6010 PRINT "Serving a page"
6020 OPEN page$ FOR input AS #2
6030 DO WHILE NOT EOF(#2)
6040 LINE INPUT #2,fl$
6045 IF reqtype$="POST" AND INSTR(fl$,"var pin") THEN GOSUB 9000
6050 PRINT #1,fl$
6060 PAUSE 1:REM "This value needs to be set higher on a slow network"
6070 LOOP
6080 CLOSE #2
6090 PRINT "Done transmiting page"
6999 RETURN
7000 REM "Pars header"
7010 PRINT "Waiting for client"
7020 in$=INPUT$(1,#1)
7030 IF in$="" GOTO 7020:REM "Wait for client"
7040 PRINT "Client called parsing header"
7050 TIMER=0
7060 DO WHILE TIMER <reqTimeOut
7070 t$=INPUT$(1,#1)
7080 IF t$<>CHR$(13) THEN
7090 in$=in$+t$:REM "Build one line"
7100 ELSE
7110 REM prinT in$;
7112 IF reqtype$="POST" THEN
7113 IF INSTR(in$,"Content-Length") THEN
7114 GOSUB 8000
7115 RETURN
7118 PRINT "hej"
7119 ENDIF:ENDIF
7120 IF INSTR(in$,"GET") THEN
7130 reqtype$="GET":REM "We have a GET req. and..."
7140 IF LEN(in$)>6 THEN
7150 IF MID$(in$,6,1)<>" " THEN
7160 err=404:REM "...if it's not for '/' page we dont have it!"
7165 RETURN
7170 ENDIF
7180 ENDIF
7185 RETURN:REM "No more parsing needed for GET"
7190 ENDIF
7200 IF INSTR(in$,"POST") THEN
7210 reqtype$="POST":REM "We have a POST req. and..."
7220 IF LEN(in$)>7 THEN
7230 IF MID$(in$,7,1)<>" " THEN
7240 err=404:REM "..if it's not for '/' page we dont have it!"
7250 RETURN
7260 ENDIF
7270 ENDIF
7280 ENDIF
7285 in$=""
7290 ENDIF
7900 LOOP
7910 timeout=1:REM "connection broke"
7999 RETURN
8000 REM "Pars POST vars"
8001 PRINT "Parsing POST vars"
8006 contLen=VAL(MID$(in$,18,LEN(in$)-17)):REM "Get the number from Header"
8014 in$=""
8015 REM "The timer is set in calling routin"
8020 DO WHILE TIMER < reqTimeOut
8030 t$=INPUT$(1,#1)
8040 in$=in$+t$
8049 REM "The rest of the data is the vars"
8050 IF LEN(in$)=contLen+3 THEN
8060 varLine$=RIGHT$(in$,contLen)
8065 REM "Split line into name/value pairs and stor in matrix VARS$"
8066 PRINT varLine$
8067 x=0
8068 y=0
8070 FOR i=1 TO contLen
8075 t$=MID$(varLine$,i,1)
8080 IF t$="=" THEN
8081 REM "Store var name"
8090 VARS$(x,y)=temp$
8095 PRINT temp$;
8100 temp$=""
8110 x=x+1
8130 ELSEIF t$="&" THEN
8131 REM "Store var value"
8140 VARS$(X,Y)=temp$
8145 PRINT temp$
8150 temp$=""
8155 x=0
8160 y=y+1
8170 ELSE
8171 REM "Just get next char"
8180 temp$=temp$+t$
8185 ENDIF
8190 REM "Error check"
8200 IF x>1 OR y>9 THEN
8210 err=1
8220 RETURN
8230 ENDIF
8300 NEXT i
8310 VARS$(X,Y)=temp$:REM"Store the rest as last value"
8320 PRINT temp$
8700 RETURN
8800 ENDIF
8900 LOOP
8910 timeout=1:REM "Connection broke"
8999 RETURN
9000 REM "This i the place to set the"
9010 REM "var pinx in the javascript to the"
9020 REM "right value"
9030 REM "This is a demo and only echo back the"
9040 REM "Post data"
9060 i=INSTR(fl$,"=")
9070 pinNo=VAL(MID$(fl$,8,i-8)): REM "extract pin no"
9075 REM "Inject the line 'var pinX=varX;' X=the pinNo"
9080 fl$="var pin"+STR$(pinNo)+"="+VARS$(1,pinNo-1)+";"
9090 PRINT "Injecting line:"
9100 PRINT fl$
9999 RETURN

 

Posted in Applications | Tagged , , , | Leave a comment

DuinoMite Music Box

Reposted and Google translated from http://skyduino.wordpress.com

http://tinyurl.com/86sznc3

Hello world!

Today Skywodd strikes again!

Yesterday I presented my program in music proudly playing MMbasic nyan the cat, and now I well up a notch and the next level (level up! :) !)

I just finished my last test program MMbasic, this is a standalone player score written entirely by me. I expected to encounter some difficulties with language MMbasic but no, my prog worked in only 2 tries!

As usual I diffuse my code under a free license, free for you to customize, to improve it, etc. ;)

And for those who will not (yet) duinomite mega-here's a video demonstration:

Ps: Scores are not me I is recovered here: http://www.siteduzero.com/forum-83-350633-p1-delire-de-geek-faites-chanter-votre-pc.html
It is imperative that. Txt files or partitions with return lines in unix and contain no spaces at the end / beginning of line.
If you are with the notepad + + just do edit> convert format online> UNIX & Publishing> treatments spaces> remove spaces at the beginning and end of line.

I put some comments (in English, it's easier for me when I debug the code) to explain the general operation.

 

Little Chef's tip:
To automatically add line numbers to your program:
nl -n rz -s " " -w1 fichiersansnumero.bas > fichieravecnumero.bas
(On Windows you need to install MinGW for this command accées ;) )

I found the experience "duinomite" truly rewarding!
I am writing the test article of the mega-duinomite, when I see it is that I could publish it in any case I really take my foot to code MMbasic!
But I do not mean forgetting my other projects, and tutorials, test, etc. … already planned ;)

Discussion

 

14 Responses to "[MMbasic] Reader musical score (Epik Win)"

  1. Great job skywodd :)

    This little card does look great, but it does not interest me at the moment :)

    Posted by schizophrenic | February 4, 2012, 20 August 35 02 352

  2. Good evening

    What attracted you the Duinomite it particularly?

    Does MMBasic is superior to other available Basic already on PIC / AVR / ARM / etc (or other kind BasicStamp Basic open-source)?

    Is it more the idea of ​​stand-alone solution (keyboard / screen)?

    As I said the other day, here reminds me of the Basic machines of the early 80 (TRS-80, Sinclair, Oric …)

    A +

    Posted by Barbudor | February 6, 2012, December 48 02,482 0

    • Level when comparing the perf duinomite a basic stamp or a CUBLOC is also fast.

      What seduced me in duinomite is the idea that you can edit / execute its code from the SD card without computer, just with a keyboard and monitor. It feels really "mini computer" and I really like.

      Posted by skywodd | February 6, 2012, December 12 35 02 352

  3. Advantage can be used in MPLAB, penguino … for the program.
    I got mine yesterday (same supplier as our host) good, I made a mistake, I took a mega, but I also got the adapter I / O, and Arduino shield, with the mega unnecessary They will if I purchase a "normal" ;)

    for nostalgia: the TRS80 was for me a Rolls, I started in 77 with a kit motorola MKD2 :)

    In fact, I buy lots of stuff and I'm not making much : ( (Lack of courage)
    Too bad it lacks an ethernet connection, it would have been perfect (I have seen with an Olimex card hack, but blah)
    I think I'll make a kind of coordinator collecting information for different gear (many interface) and providing both a human interface and transmission of orders to "slaves". I will hang the map on the back of a LCD Monitor 17 "lying around here and insert the power supply on it.

    Something marked or almost anywhere: to connect the keyboard is a QWERTY ;)

    And thank you for your blog.

    Published by John Paul Rouzé | February 11, 2012, 11 November 36 02 362

    • >> I got mine yesterday (same supplier as our host) good, I made a mistake, I took a mega, but
      >> I also took the I / O adapter and arduino shield, with the mega useless, they will if I purchase a "normal"
      The adapter shield is usable even with the mega I think.

      >> Too bad it lacks an ethernet connection, it would have been perfect (I have seen with an Olimex card hack, but blah)
      The duinomite EMEGA-released a few weeks, it will have the same functionality as normal but with the mega ethernet, embedded flash memory, etc. …
      http://www.olimex.com/dev/duinomite-emega.html

      Something >> marked or almost anywhere: to connect the keyboard is a QWERTY
      I had stated in my first video (the music nyan cat).
      I planned a full test of the map to the middle of next week ;)

      Posted by skywodd | February 11, 2012, February 14 12 02 122

  4. Hello,
    I have integrated keyboards FR, GR and IT in the MM Basic v3.1 is available on the website of MM.
    Therefore, no need to look for keys on the keyboard ;)
    In addition you can remove the line numbers!

    @ + +

    Fabrice.

    Posted by Fabrizio | February 14, 2012, May 17, 17 02 172

  5. @ Jean-paul Rouzé: I know if he wants to "return" code, but switching to GNU GPL owner will not solve its problems of fragmentation of syntax, let alone bring him money.

    Posted by skywodd | February 14, 2012, September 21 54 02 542

  6. Thank you for this article.C is all I can say.

    Posted by dj animation 76 | February 15, 2012, February 2 38 02 382

  7. Wow, you are on Hackaday!

    Posted by vl_ | March 1, 2012, December 23 03,233 0

    • Yeah I saw, but it's not the first time ;)

       

 

Posted in Applications | Tagged , , , , , , , | Leave a comment