Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:24 25 Nov 2024 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 : (DM) Beta Firmware Update.

Author Message
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 10:58am 21 Dec 2011
Copy link to clipboard 
Print this post


(DM) Beta Firmware Update.

We now have a DuinoMite Mailing list for firmware updates & News at:
http://www.dontronics-shop.com/mailing-list-dontronics-newsl etter.html

I announced this recently on this forum.
The below mailing list message was sent a few hours ago:

Please Note. We have all the bugs sorted now, right up to V2.7b, even thought we don't have access to the the source code. However these minor bugs aren't included in this beta version, but should be included the next time around.

The PDF manual is now at around 220 pages, and been checked for grammar and English. There is still to be a lot more added in the way of new commands, settings, and UEXT peripherals with sample code.

=================================================

-2011-12-21
DuinoMite Mailing list Subscribers, please note.

There is a beta version of DuinoMite firmware available from:
http://tinyurl.com/6qvq7au

Make sure you have a backup copy of your firmware before updating.

If you have any questions or feedback, please post them to:
http://www.kenseglerdesigns.com/cms/forums/viewforum.php?f=4

We wanted to get something out prior to Christmas so users can see what has been done to date. There won't be a lot done over the festive season, so anything new will have to wait until the new year.

Many thanks to Ken Segler for the massive amount of work he has done on this project. Many of you may not be aware that Gerard Sexton joined the DuinoMite team, and was responsible for the I2C code in Maximite BASIC. He has just completed the beta version of the One wire code for the DuinoMite.

Hopefully all of these improvements will be migrated back into the MaxiMite eventually.

Merry Christmas, and a happy new year to all.

Cheers Don...

================================================

Ken Segler:

need some testers this is a beta version

setpin for freq and period on pins 5 6 7 works .
pin(21) returns battery voltage

turn off trace on NEW
TRON SERIAL will put trace info on serial/usb and not video

screen saver added to setup 5 - 60 minutes in 5 minute increments
PRINT MM.BLANK so you can check how much time till screen blank in seconds
you can also do MM.BLANK 0 to blank the screen or MM.BLANK 200 to add 200 seconds to timeout

sleep minute // Sleep for 1 minute from current time date
sleep Hour // Sleep for 1 hour from current time date
sleep day // Sleep for 1 day from current time date
sleep week // Sleep for 1 week from current time date
sleep month// Sleep for 1 month from current time date
sleep year // Sleep for 1 year from current time date

after it wakes check MM.SLEEP
1 = Sleep completed
2 = pin 7 ext Interrupt
4 = BUT Interrupt
8 = PS/2 Interrupt

================================================

Gerard Sexton: One Wire code....

I have attached some updated code that supports one wire products. There are now 4 commands and 2 functions:

OWRESET pin [,presence]
OWWRITE pin, flag, length, data [, data…]
OWREAD pin, flag, length, data [, data…]
OWSEARCH pin, srchflag, ser [,ser…]

The OWRESET and OWSEARCH commands (and the OWREAD and OWWRITE commands if a reset is requested) set the MM.OW variable:
1 = OK (presence detected, search successful) else 0 = Fail (presence not detected, search unsuccessful).

Where:
pin - the MMBasic I/O pin to use

presence - an optional variable to receive the presence pulse (1 = device response, 0 = no device response)

flag - a combination of the following options:
1 - send reset before command
2 - send reset after command
4 - only send/recv a bit instead of a byte of data
8 - invoke a strong pullup after the command (the pin will be set high and open drain disabled)

length - length of data to send or receive

data - data to send or receive

srchflag - a combination of the following options:
1 - start a new search
2 - only return devices in alarm state
4 - search for devices in the requested family (first byte of ser)
8 - skip the current device family and return the next device
16 - verify that the device with the serial number in ser is available
If srchflag = 0 (or 2) then the search will return the next device found

ser - serial number (8 bytes) will be returned (srchflag 4 and 16 will also use the values in ser)

After the command is executed, the pin will be set to the NOT_CONFIGURED state unless flag option 8 is used.

The data and ser arguments can be a string, array or a list of variables.

OWCRC8(len, cdata [, cdata…]) Processes the cdata and returns the 8 bit CRC
OWCRC16(len, cdata [, cdata…]) Processes the cdata and returns the 16 bit CRC

Where:
len - length of data to process

cdata - data to process

The cdata can be a string, array or a list of variables.

An example of using the code to read the temperature (and all registers) from a DS18B20 (with external power) and search and verify the serial number:

================================================

new
10 dim ar(10)
20 p = 18
30 owreset p,presence:? "Presence: ";presence;
35 precision = 3 : gosub 500
40 owwrite p,1,2,&hcc,&h44
50 for i = 1 to 12000
60 owread p,4,1,b
70 if b = 1 then
80 if (i mod 8) = 0 then exit for
90 endif
100 next i
120 owwrite p,1,2,&hcc,&hbe
130 owread p,2,9,ar(0)
140 ? ", Data: (";ar(0);",";ar(1);",";ar(2);",";ar(3);",";ar(4);",";ar(5);" ,";ar(6);",";ar(7);",";ar(8);
150 owreset p,presence:? " ), Presence: ";presence
155 ? "CRC: ";owcrc8(9,ar(0))
160 tl = ar(0) : th = ar(1)
170 if (th and &h80) then
190 temp = ((tl and &h0f) * 0.0625) + ((tl and &hf0) / 16) + ((th and &h07) * 16) - 128
200 else
220 temp = ((tl and &h0f) * 0.0625) + ((tl and &hf0) / 16) + ((th and &h07) * 16)
230 endif
240 tempf = ((temp * 9) / 5) + 32
250 ? "Temp: ";temp;"C, ";tempf;"F"
260 owsearch p,1,ar(0)
262 if mm.ow = 0 then
264 ? "Search failed"
266 else
270 do while mm.ow = 1
280 ? "Serial number: (";ar(0);",";ar(1);",";ar(2);",";ar(3);",";ar(4);",";ar(5);" ,";ar(6);",";ar(7);" )"
290 owsearch p,0,ar(0)
300 loop
310 endif
320 owsearch p,16,ar(0)
330 if mm.ow = 1 then
340 ? "Serial number: (";ar(0);",";ar(1);",";ar(2);",";ar(3);",";ar(4);",";ar(5);" ,";ar(6);",";ar(7);" )"
350 else
360 ? "Verify failed"
370 endif
390 end
500 if precision = 4 then
510 owwrite p,1,5,&hcc,&h4e,&h00,&h00,&h7f
520 elseif precision = 3 then
530 owwrite p,1,5,&hcc,&h4e,&h00,&h00,&h5f
540 elseif precision = 2 then
550 owwrite p,1,5,&hcc,&h4e,&h00,&h00,&h3f
560 else
570 owwrite p,1,5,&hcc,&h4e,&h00,&h00,&h1f
580 endif
590 return

================================================

NOTE **** as some of the code uses square brackets, and is auto adjusted,
the original mailing list text can be viewed at:
http://ymlp.com/zfMJBi

Cheers Don...

https://www.dontronics.com
 
DuinoMiteMegaAn
Senior Member

Joined: 17/11/2011
Location: Australia
Posts: 231
Posted: 05:03pm 25 Dec 2011
Copy link to clipboard 
Print this post

@Ken

sleep minute // Sleep for 1 minute from current time date
sleep Hour // Sleep for 1 hour from current time date
sleep day // Sleep for 1 day from current time date
sleep week // Sleep for 1 week from current time date
sleep month// Sleep for 1 month from current time date
sleep year // Sleep for 1 year from current time date


If you are using the sleep command for greater than 1 day and you are also using the "32768 watch crystal" for sleep timing then you might want to re-think your code. My testing reveals, using the DS3231 precision real time clock, 10's of seconds drift everyday! Unless you can keep the ambient temperature on the board within a few degress of the crystal's calibration then the time error is reduced.

Note: In my testing, I have a setback thermostat which reduces the temperature at night time greater than 10-15 degress F.
 
ksdesigns

Senior Member

Joined: 25/06/2011
Location: United States
Posts: 143
Posted: 05:49pm 25 Dec 2011
Copy link to clipboard 
Print this post

The internal rtcc is not that good yet need to add a calibration to the setup menu .
but if you are using that dallas part you could use the INT pin out of the DS3231 and run it to pin7 (D10) on the DuinoMite and use that to take it out of sleep also it has a 10k pullup on it .
ken



29.3.10 Calibration
The real-time crystal input can be calibrated using the periodic auto-adjust feature. When properly calibrated, the RTCC can provide an error of less than 0.66 seconds per month. Calibration has the ability to eliminate an error of up to 260 ppm.
The calibration is accomplished by finding the number of error clock pulses and writing this value into the calibration bit fields (RTCCON<9:0>). This 10-bit signed value will be either added or subtracted from the RTCC timer once every minute. Use the following procedure for RTCC calibration:
1. Using another timer resource on the device, the user must find the error of the 32.768 kHz crystal.
2. Once the error is known, it must be converted to the number of error clock pulses per minute, as shown in Equation 29-1.
Equation 29-1: Calculating Error Clocks Per Minute
3. Based on the result from step 2, the following options are available:
a) If the oscillator is faster than ideal (negative result from step 2), the calibration bit fields (RTCCON<9:0>) value needs to be negative. This causes the specified number of clock pulses to be subtracted from the timer counter once every minute.
b) If the oscillator is slower than ideal (positive result from step 2), the calibration bit fields (RTCCON<9:0>) value needs to be positive. This causes the specified number of clock pulses to be added to the timer counter once every minute.
4. Load the calibration bit fields (RTCCON<9:0>) with the correct value.
Writes to the calibration bit fields (RTCCON<9:0>) should only occur when the timer is turned off, or immediately after the rising edge of the seconds pulse (except when the seconds bit fields (RTCTIME<14:8>) are 0x00, due to the possibility of the auto-adjust event).
 
DuinoMiteMegaAn
Senior Member

Joined: 17/11/2011
Location: Australia
Posts: 231
Posted: 06:11pm 25 Dec 2011
Copy link to clipboard 
Print this post

the RTCC can provide an error of less than 0.66 seconds per month.


1. But what Microchip neglects to tell you is that the calibration is at a fixed temperature (ambient) and any deviation from this temperature curve will create greater time errors. That is where a TCXO - Temperature controlled oscillator works better. What is really needs to be done is to add a small UEXT dongle using the 8 pin DS3231m with coin cell battery holder. Add this to the internal UEXT connector.

2. It takes some very expensive calibration test equipment to do this calibration. It should have already been done at the factory eg Olimex. This means every DM board should have a unique set of calibration curves to match the watch crystal?

and run it to pin7 (D10) on the DuinoMite

3. I think that is a shared pin number? ... using pins 1 or 2 (with a pullup) would be a better choice.


Edited by DuinoMiteMegaAn 2011-12-27
 
ksdesigns

Senior Member

Joined: 25/06/2011
Location: United States
Posts: 143
Posted: 06:20pm 25 Dec 2011
Copy link to clipboard 
Print this post

Pin 7 is for spi slave select but is not used at this time and is not shared with anything plus it is a INT pin ..
and the microchip calibration just calibrates it to the internal clock anyway that will drift with temp anyway ..
and using pin 7 after sleep check mm.sleep
1 = RTCC
2 = ExtInt pin 7
then if you get a RTCC int before ExtInt From the DS3231 go back to sleep

ken


 
DuinoMiteMegaAn
Senior Member

Joined: 17/11/2011
Location: Australia
Posts: 231
Posted: 06:29pm 25 Dec 2011
Copy link to clipboard 
Print this post

My main point is using the sleep to wake up the DuinoMite in an application
that does "data logging" at different temperatures (other than ambient)
could lead to large timing errors.
 
DuinoMiteMegaAn
Senior Member

Joined: 17/11/2011
Location: Australia
Posts: 231
Posted: 12:13am 26 Dec 2011
Copy link to clipboard 
Print this post

BTW ... You should think seriously again about using Pin #7 (D10) as an alternative input interrupt pin. If you get your SPI to work in hardware @ 20 MHZ then this pin would be needed for the SPI SS# on the Arduino Shield!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024