DS1302 Julian
dbj
Posts: 75
Trying to figure out how to return days julian from DS1302, Says Error 10
how do you look for this type of error. Thanks
how do you look for this type of error. Thanks
Comments
SX/B does not allow more than 1 math operator per line.
You'll have to use some temporary variables to hold the results as you build the expression.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
Alex.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fear not that your project does not work, for it will,
Fear not if you see·a long dark path ahead, but follow it,
Fear not if what worked now refuses to,
For the only thing that's perfect is imperfection.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
Bean,
I have a few questions about the formula you presented. Where did you obtain it? What is the order of operation? Is it strictly left to right?
The standard order of operations implies that 1 should be multiplied by 30 before being subtracted from the month. Since 1 * 30 is always 30, this is a wasted calculation and surely not what you meant! If the order of operation is strictly left to right, then the Max 1 statement near the end will return a 1 or a 0 which will be added to 1 plus the day. I am fairly certain that is not right either, hence my questions. Can you (or someone else) help me better understand how to implement this formula?
Also, I believe the result will require more than a simple word variable, probably three bytes at least. Is this easy to work around?
- Sparks
That is a forumla in the file that dbj posted. I have no idea where it came from.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
dbj,
I do not understand your formula!
- Sparks
Instead of having the DS1302 generate the full calendar date, then having your code turn the date parts into a count by applying a fairly elaborate set of calculations, the DS1371 could deliver you a continuous count in seconds, and you'd have a much simpler calculation to convert it to a Julian number of just a single division by the number of seconds per day, then adjust the result with an origin offset.
David
www.emesys.com/BS2math4.htm#JulianDate
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Also, I have seen many threads with different questions related to bugs·in SX/B. Although harder to understand, the assmembler is straightforward and·problem free.
We can choose to·start a useless argument·about this, but it is obvious that you are a fanboy of SX/B supporting SX/B because you wrote it, while I am using my programming experience to select the best coding method.
Alex.
To answer your question, zero. The assembler does not allow any operator.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fear not that your project does not work, for it will,
Fear not if you see·a long dark path ahead, but follow it,
Fear not if what worked now refuses to,
For the only thing that's perfect is imperfection.
Post Edited (Mr_Nuke) : 1/22/2007 9:30:08 PM GMT
I think SX/B is a great way for some to use the power of the SX without the steep learning curve of pure assembly. In short, it's just another [noparse][[/noparse]useful] tool to have in one's shed....