Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:11 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : using OpenLog with the micromite

     Page 2 of 3    
Author Message
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 11:21am 17 Mar 2019
Copy link to clipboard 
Print this post


Way to go Rob !!
Sounds like a good "black box" module for SD access.
I tried a similar thing a while ago, using more atmel interrupts
for a second spi i/o, but it was very slow as there was
a standard inbuilt delay on one of those interrupts processing (gee, I was so
pleased to find that out ...Not Happy Janet...) .
The serial i/o at 115200 should be much better.
I am interested - will probly get a sparkfun module to start
off, and I see a panelized eagle pcb is on github...
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 12:14pm 17 Mar 2019
Copy link to clipboard 
Print this post

i've order a couple of the cheap programmers from ebay:
https://www.ebay.com/itm/263425223937
and
https://www.ebay.com/itm/322768772090

my money is on the arduino shield one working better :-) i already have a uno here to attach it to.

however, so far i've been using a genuine atmel AVRISP mk2, wired up to the OpenLog thus:



things to note:
1.you need to attach wires to the four vias above the word "OpenLog". on the units i have this was a bit of a challenge as there was silkscreen running right up to the edges of the holes. indeed, this may be why they were delivered unprogrammed; they may have been reject units.

2. 5v must be supplied to the OpenLog seperately and also fed back into the AVRISP. the Vcc pin on the cable to the AVRISP is an input only. it looks like other programmers can be jumpered to supply 5v directly to the target.

3. the AVRISP requires installing libusb0.1 drivers, obtainable from here:
https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/
do NOT attempt to use any drivers supplied by atmel, they will not work with avrdude - avrdude is used by the arduino IDE to talk to atmel devices.



next step, software to install:
you'll need the arduino IDE, downloaded from here:
https://www.arduino.cc/en/main/software
you need to scroll down past the web-based version to get to it. installation is pretty simple.

once you have the IDE up and running, you need to connect the OpenLog board as outlined above, then from the Tools menu select:

1. your programmer (AVRISP mk2 in my case),
2. the target type (use Arduino UNO for the OpenLog),
3. (possibly???) the comm port your programmer is attached to,
4. then lastly select Burn Bootloader.

all going well, you should get a happy message in the status area at the bottom of the window telling you everything has gone as planned (yeah, right!)


with the bootloader in place, you can now disconnect your OpenLog from the AVRISP and complete everything else using a USB to serial bridge attached to the OpenLog's 6-pin connector. the OpenLog will operate off 5v USB power directly (it has an onboard 3v3 regulator), and in addition requires RxD, TxD, and RTS. I'm using a CP2102 bridge that has RTS broken out on an extra header. this needs to be connected to the pad marked "GRN" on the OpenLog.

the first thing you want to do now is select Files -> Examples -> 01.Basics -> Blink. adjust to the correct comm port under Tools -> Port, then click on the button just below the word Edit that has a blue right-arrow on it. this will (in theory) compile the 'blink' program and upload it to the OpenLog - once finished the blue LED on the OpenLog will start blinking, 1/2 second on, 1/2 second off.

congratulations, by some miracle you have got here. tomorrow evening i'll detail building the OpenLog firmware .hex file.


cheers,
rob :-)

Edited by robert.rozee 2019-03-18
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 12:48pm 17 Mar 2019
Copy link to clipboard 
Print this post

note: while the above seems quite complicated, it can actually be simplified a fair bit using just the right bits picked out of the arduino IDE's setup. key things are:

1. the optiboot bootloader .hex image,
2. avrdude.exe,
3. the right magic incantations to feed into avrdude,
4. a pre-compiled .hex of the OptiBoot firmware.

peter: i'm picking that only some OpenLog boards lack firmware, but couldn't say what percentage. grogster and i got out boards from very different sources.

turbo46 and grogster: as it happens i'd though the same thing this afternoon, that a MX1x0 could be used instead of a 328p. the 328p has 32k of flash, 2k of ram, and is usually used with an external crystal. an MX150 has 128k/32k and has a stable fast clock without an external crystal. with the extra flash space a PIC32 could also serve as an I/O expander using the spare pins.


cheers,
rob :-)

Edited by robert.rozee 2019-03-18
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 03:06pm 17 Mar 2019
Copy link to clipboard 
Print this post

I've successfully used the cheaper ones (USBASP) (and with those dupont lead things).

I think the Arduino IDE may actually run avrdude behind the scenes.

JohnEdited by JohnS 2019-03-19
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 09:20pm 17 Mar 2019
Copy link to clipboard 
Print this post

I think it is worth using the openlog because the SD access
library is maintained by the atmel/duino community. Otherwise it means
sorting out all the SD card variants and programming the access which is
(or there was a history of) really awkward for little gain.
And you can buy openlogs off the shelf already working - save the hassle.Edited by chronic 2019-03-19
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:26am 18 Mar 2019
Copy link to clipboard 
Print this post

I have found some more of the clones. These ones seem to have a purple soldermask, and the photos do show the programming pins being accessible via....vias!

Here is the link.

US$2.88 each - wow.....

They might be blank also, but we'll see - I have ordered a couple.
I see on the listing I posted in the previous page of this thread, someone after me has purchased FIFTY units. I expect they will ALL be blank, and that buyer will not be a happy chappy.....

I did update my feedback to state that the ones I got are totally blank and will not work until you program them - despite the listing stating they are pre-programmed.(but they are not)
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 12:46pm 18 Mar 2019
Copy link to clipboard 
Print this post

Just spent an hour and a half writing a detailed post on compiling the OpenLog firmware, however firefox revealed a neat bug in the Show All History option and erased it all
as a result, the below is the short version:

use the contents of the attached zip file:
2019-03-18_223354_OpenLog_4.2_plus_libraries.zip

this contains version 4.2 of OpenLog.ino, the latest version (1.1.0) of the SdFat library, and the SerialPort library with two required modifications already made. sparkfun's repository contains a much older beta version of SdFat and an unmodified SerialPort.

unzip the zip file into the Arduino folder (automatically created within your My Documents folder by the arduino ide). the SdFat and SerialPort folders should now be moved into the library folder that is sitting within the Arduino folder, giving you the following structure:
My Documents -> Arduino -> library -> SdFat
My Documents -> Arduino -> library -> SerialPort
My Documents -> Arduino -> OpenLog

change to the OpenLog folder, double-click on OpenLog.ino, then when it has been loaded into the ide click on the button just below the word Edit that has a blue right-arrow on it. the OpenLog firmware should be compiled and uploaded to your OpenLog.

if you get a segmentation fault, try going to Tools -> Board -> Board Manager and install a slightly earlier version of "Arduino AVR Boards". it seems this is a know problem with the arduino ide that pops up now and then, i had to revert to one version back to make things compile.


cheers,
rob :-)

Edited by robert.rozee 2019-03-19
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 04:53am 20 Mar 2019
Copy link to clipboard 
Print this post

Following your posts with interest, Rob. I have ordered one of the programmer things, and have installed the Arduino IDE. Everything is setup as you say, I am just waiting on the programmer and the purple modules. I will try the purple ones first, but I fully expect them to be blank.
Smoke makes things work. When the smoke gets out, it stops!
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 08:11am 23 Mar 2019
Copy link to clipboard 
Print this post


Amazon aus have them at

aus

and I think microchip can supply atmel chips preprogrammed now (?)
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 08:20am 23 Mar 2019
Copy link to clipboard 
Print this post

On the Amazon ones - again - are they actually programmed?

Microchip can supply programmed chips, yes, but there is a MOQ(minimum order quantity) of about 100 chips last time I checked. That's still quite a lot of cash for hobbyists. So, per-unit programming is the way to go for now.

Happy to be proven wrong.
Smoke makes things work. When the smoke gets out, it stops!
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 08:26am 23 Mar 2019
Copy link to clipboard 
Print this post

Didn't know about the MOQ...
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 08:31am 23 Mar 2019
Copy link to clipboard 
Print this post

Most MCU(micro-controller unit) suppliers WILL pre-program chips for you, but they pretty much all have a MOQ. You can't just get ten chips pre-programmed in other words. Many plants have a MOQ of 250 or more. It is not worth it to them, to do less. This is all fine if you need thousands of programmed chips though.
Smoke makes things work. When the smoke gets out, it stops!
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 09:59am 23 Mar 2019
Copy link to clipboard 
Print this post

I had a quick squiz at the MicroChipDirect FAQ etc.
It looks like there is a US$60 minimum order for preprogrammed chips,
which includes a US$29 setup each time. So you'd get maybe 14 atmega chips,
then have to add delivery and so on. Not bad but as you say, probably still better to get a programming device and use that initially
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 01:57pm 26 Mar 2019
Copy link to clipboard 
Print this post

Well I got a Sparkfun unit today. Working fine so far.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 09:37am 27 Mar 2019
Copy link to clipboard 
Print this post

I would fully expect that. SparkFun are the original producer of the module, so they should indeed work fine.
Smoke makes things work. When the smoke gets out, it stops!
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 09:55pm 28 Mar 2019
Copy link to clipboard 
Print this post

Hi,
My two questions:
1) given the MM170 knows the date and time, how do I get the Openlog to open new files with the correct date and time rather than 2:00 am on 1/1/2000?
2) this is the only documentation I can find - is there more out there?

Cheers, Andrew

(I have an Openlog (Sparkfun) that I use to record the sentences passing around my HC-12 network of about 10 transmitters. As the MM starts up it requests a date and time message from the base and sets its date/time. Every two hours the base station transmits the date and time (from a GPS module) to the whole network. But the Openlog initialises to the wrong date and time as soon as power is applied - I'd like to be able to set its date and time correctly before it opens a new file.
This is only a minor annoyance as the files are named sequentially and I time and date-stamp each message as it is recorded.)
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 01:32am 29 Mar 2019
Copy link to clipboard 
Print this post


  Quote  given the MM170 knows the date and time, how do I get the Openlog to open new files with the correct date and time rather than 2:00 am on 1/1/2000?



In the interim you could set the filename to specify day and time maybe, that is often used as a method in other systems. You will need a way to catch the date/time info from ... I don't think the openlog runs a rtc as such (?).

The file creation time is left as default values.
I have used a method in the SDfat libraries whereby you can set a defined text string to contain the time and date, and feed the string as an additional argument to the new file command.
There was a line that had to be added to enable it, it worked OK but I don't know if the openlog can use/requires it.


Edited by chronic 2019-03-30
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 02:03am 29 Mar 2019
Copy link to clipboard 
Print this post

As far as the OpenLog module itself is concerned, I don't think there is any way for you to specify the date and time of the file when it is actually written to the card by the OpenLog module. I think it just defaults to midnight in the year 2000 each time you power it up, and I don't THINK there is any way you can change that. If that is what you are trying to do, I don't think it is possible with the current firmware.

You CAN, however, record the date and time as seen by the 170 chip, as part of the message you send to the OpenLog to log, and then you can still get your date and time references from within the messages that are logged by the module if you see what I am getting at.
Smoke makes things work. When the smoke gets out, it stops!
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 03:30am 29 Mar 2019
Copy link to clipboard 
Print this post

Hi Chronic and Grogs,
I don't think OpenLog has a command to set a file name - it just defaults to the next one in the sequence. (yes I could write a routine to read the date/time off the first record and rename the file after it is closed but I am trying to name it as it is opened).

Grogs - yes I do log the date and time with each message. Here is one sample line of a log (no quotation marks are included):
"21-03-2019,07:59:35,$AGAM,25.5,4*22"

The actual transmission is: "$AGAM,25.5,4*22"
I add the "21-03-2019,07:59:35,"

I suspect that it can't be done - too bad.

Have you come across any documentation?

Cheers,

Andrew

(In my message above; station number "4" is reporting a temperature of "25.5" and the checksum is "22" HEX.)
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 03:44am 29 Mar 2019
Copy link to clipboard 
Print this post

Hello.

Here is a link to the SparkFun documentation and setup guide. It's quite comprehensive.
Smoke makes things work. When the smoke gets out, it stops!
 
     Page 2 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025