pub myFC@ ( offset -- byte )
?DUP IF FSIZE@ MIN FILE@ + 0 MAX XC@ ELSE FALSE THEN
I see ~1000 byte reads in 87ms. The virtual file system and FC@ are great because it allows pre-calculated atan tables to be stored on uSD in whatever resolution is required. Great for sensor calibrations, response curves and corrections.
It will be a long while before these hit 4GB. I hope
Just try the standard RTC words that are built into EXTEND. There are two main types as most RTCs have similar register arrangement although some like to use unused bits of BCD registers for various flags. Select DS3231 and try setting and reading the time and date as the unused bits are masked off.
Thanks Peter. Am I correct in assuming that V2.7 (VGA-Explorer.binary) will give me the words needed? I hope to breadboard this up over the weekend. I'm trying to have a Propeller Proto Board talk to a board from adafruit ( https://www.adafruit.com/products/2345 ) ... This link shows the display I want to talk to, as well as the 'HAT' board that talks to it.
I wonder what goes through their minds when they make a board like this, the RTC could have been a very accurate DS3231 with temperature sensing to boot and the EEPROM for cents extra could have been 64k bytes or more rather than 4k bytes (32k bits). If they had opted for any voltage in too such as 8 to 24V they could have used a switching regulator and allowed the use of much lower currents (<1A @24V) but the circuitry they have simply shuts off if more than 5V is used.
I wonder what goes through their minds when they make a board like this, the RTC could have been a very accurate DS3231 with temperature sensing to boot and the EEPROM for cents extra could have been 64k bytes or more rather than 4k bytes (32k bits). If they had opted for any voltage in too such as 8 to 24V they could have used a switching regulator and allowed the use of much lower currents (<1A @24V) but the circuitry they have simply shuts off if more than 5V is used.
Probably aiming for lowest cost rather than widest market. Being involved in the industrial/building automation area I would be certainly be willing to pay a bit extra for boards that could run on a 5 to 24V input voltage range.
Thanks MJB! I had seen a few approaches, including a simple approximation by CessnaPilot that was good to 1 degree as written, probably could be tweaked with fractional degree parameters. I haven't coded CORDIC, but I would bet it would be slower than tables. Plus, the VM files will make 3D calibration and 3D corrections for cross-channel couplings and magnetic issues on my IMU compass/ AutoHelm a piece of cake. I was getting 25 Hz using floating point SPIN; I'll bet that Tachyon will push 100 Hz.
Mind you, watching me code Tachyon is like watching paint dry ... I have good (?) smoothing filters and PID methods built, now on to the sensors.
While this board might have its critics ( https://www.adafruit.com/products/2345 ) ... is it safe to assume I can use the words found in V2.7 VGA-Explorer binary to get me started? Has anyone else attempted to write code for this board?
While this board might have its critics ( https://www.adafruit.com/products/2345 ) ... is it safe to assume I can use the words found in V2.7 VGA-Explorer binary to get me started? Has anyone else attempted to write code for this board?
I'm designing boards all the time so I tend to be a bit critical when there are simple things that are not done!
However I think I had mentioned that the DS1307 will work the same for time and date as the DS3231 class that's built into both Explorer images. Just type DS3231 and if you run BACKUP it will lock it in.
"Once you have wired up your RTC module. enter and upload the following sketch. Although the notes and functions in the sketch refer only to the DS3231, the code also works with the DS1307"
So to the Tachyon words should be just fine as Peter suggests.
And where do I donate coffee and donuts to everyone working on the Tachyon Glossary. Please keep going with examples too, especially language extension examples.
Could someone please help me understand how & when Tachyon enforces case sensitivity? "Abc" "aBc" and "abC" seem to be recognized as 3 distinct words, but "3rd" gets interpreted as "3RD" sometimes, and as something else later. ".s" always resolves to ".S"
Thanks!
5 4 3 2 1 ok
.s Data Stack (5)
$0000.0001 - 1
$0000.0002 - 2
$0000.0003 - 3
$0000.0004 - 4
$0000.0005 - 5 ok
3rd .s Data Stack (6) \ "3rd" is interpreted as "3RD" here
$0000.0003 - 3
$0000.0001 - 1
$0000.0002 - 2
$0000.0003 - 3
$0000.0004 - 4
$0000.0005 - 5 ok
3rd .s Data Stack (7) \ "3rd" not interpreted as "3RD"
$0000.0003 - 3
$0000.0003 - 3
$0000.0001 - 1
$0000.0002 - 2
$0000.0003 - 3
$0000.0004 - 4
$0000.0005 - 5 ok
pub Abc ." Abc " ; ok
pub aBc ." aBc " ; ok
pub abC ." abC " ; ok
Abc Abc ok
abC abC ok
pub ALL3 Abc CR aBc CR abC CR ; ok
ALL3 Abc
aBc
abC
ok
There are side effects of converting any unrecognized word not found in the dictionary into uppercase and searching one more time before trying to convert it to a number. Then there is the quick number check before searching the dictionary too however 3rd seems to be interpreted as 3<symbol>d where is is the suffix for decimal numbers.
Testing:
34rd . 34 ok
34rh . 52 ok
34ra??? ok
34rb??? ok
011rb . 3 ok
So 34rd resolves as 34<symbol>decimal, 34rh resolves as 34<symbol>hex, whereas 34ra is not valid and 34rb cannot resolve as a binary number but 011rb can.
Mixing symbols with numbers was allowed in Tachyon because there wasn't any real valid reason to say no and it was useful for inputting numbers such as:
DATES - 5/8/2016 ( 5th of August or the 8th of May, which is why I hate this format preferring to say 160508 as YYMMDD)
PINS - #P26
etc
Thanks Peter ... so it seems that if I define and use the words consistently, I'm good with whatever case I choose. That works.
as a general rule of thumb
- ACTIONWORD are all upper
- myvariable are all lower
helps read the code.
but you can do as you like.
Peter put in this typo-fixer which if the word is not found converts it to all UPPER and tries again.
this is quite handy at time especially working interactiely
Some standards just seem to evolve, despite their superior format. YYMMDD or YYYYMMDD is one of those that should have been a worldwide standard many years ago!
Should I not see the clock on pin 10 ? I've tried manually setting ce, I think I'm forgetting something here basic.
Sounds right although MJB reckons there is a problem with the & processor but I just tried this and it seems right:
&13.12.11.10 .LONG 0D0C.0B0A ok
The inline colon format is also good for converting decimal to hex and so 13:12:11:10 works as well too:
13:12:11:10 .LONG 0D0C.0B0A ok
I've noticed that SPIPINS does make CLK and MISO outputs but not CE which used to be set manually but is now set automatically on any transfer and instead of manually releasing it you can just use the new SPICE instruction without parameters which will take CE high with the minimum of fuss.
Now that I am working with all my source files direct from dropbox you can load the latest EXTEND which includes making CE and output.
Alright then I'm back to checking my logic analyzer connections..........
Just making sure I didn't forget something here basic with the SPIWR... words
here are two captures the first is test code to exercise pins and logic analyzer and the other one is a SPIWRB but I'm only seeing two clocks?
Latest Kernel and Extend
13 HIGH ok
forget logic ok
pub logic
13 LOW
10 APIN
25 KHZ
20 TIMES 12 HIGH 12 LOW 11 HIGH 11 LOW NEXT
13 HIGH
MUTE
; ok
ok
ok
logic ok
&13.12.11.10 SPIPINS ok
ok
SPICE ok
----------------------------------------------------------------
ok
#170 SPIWRB SPICE ok
Can someone point me to an example or guide to "grafting" an existing PASM object (something like an OBEX item) with Tachyon?
Maybe an example is already in the codebase, but my searching/understanding skills weren't up to the task of finding it.
Thanks for the hard work and fun discussions here.
The current kernel fills up the entire image of the prop with just 33 longs left. In order to add a PASM object you must currently craft it into the kernel by removing other code. Peter was/is/maybe gonna create a generic way to take an existing PASM object, add some specific code to that PASM object so it could be "called" (loaded from SDCard) by the Tachyon kernel as necessary. I'm sure Peter will comment more soon.
Comments
I see ~1000 byte reads in 87ms. The virtual file system and FC@ are great because it allows pre-calculated atan tables to be stored on uSD in whatever resolution is required. Great for sensor calibrations, response curves and corrections.
It will be a long while before these hit 4GB. I hope
pub FFC@ FILE@ + XC@ ;
here is an alternative to calculate ATAN from @Bean
cordic-for-dummies
Probably aiming for lowest cost rather than widest market. Being involved in the industrial/building automation area I would be certainly be willing to pay a bit extra for boards that could run on a 5 to 24V input voltage range.
Thanks MJB! I had seen a few approaches, including a simple approximation by CessnaPilot that was good to 1 degree as written, probably could be tweaked with fractional degree parameters. I haven't coded CORDIC, but I would bet it would be slower than tables. Plus, the VM files will make 3D calibration and 3D corrections for cross-channel couplings and magnetic issues on my IMU compass/ AutoHelm a piece of cake. I was getting 25 Hz using floating point SPIN; I'll bet that Tachyon will push 100 Hz.
Mind you, watching me code Tachyon is like watching paint dry ... I have good (?) smoothing filters and PID methods built, now on to the sensors.
I'm designing boards all the time so I tend to be a bit critical when there are simple things that are not done!
However I think I had mentioned that the DS1307 will work the same for time and date as the DS3231 class that's built into both Explorer images. Just type DS3231 and if you run BACKUP it will lock it in.
"Once you have wired up your RTC module. enter and upload the following sketch. Although the notes and functions in the sketch refer only to the DS3231, the code also works with the DS1307"
So to the Tachyon words should be just fine as Peter suggests.
And where do I donate coffee and donuts to everyone working on the Tachyon Glossary. Please keep going with examples too, especially language extension examples.
Thanks!
Testing:
34rd . 34 ok
34rh . 52 ok
34ra??? ok
34rb??? ok
011rb . 3 ok
So 34rd resolves as 34<symbol>decimal, 34rh resolves as 34<symbol>hex, whereas 34ra is not valid and 34rb cannot resolve as a binary number but 011rb can.
Mixing symbols with numbers was allowed in Tachyon because there wasn't any real valid reason to say no and it was useful for inputting numbers such as:
DATES - 5/8/2016 ( 5th of August or the 8th of May, which is why I hate this format preferring to say 160508 as YYMMDD)
PINS - #P26
etc
- ACTIONWORD are all upper
- myvariable are all lower
helps read the code.
but you can do as you like.
Peter put in this typo-fixer which if the word is not found converts it to all UPPER and tries again.
this is quite handy at time especially working interactiely
Working with a new SPI chip and having no luck seeing a clock line even?
That's funny, I've been using that stuff. Do you have some code I can check?
Should I not see the clock on pin 10 ? I've tried manually setting ce, I think I'm forgetting something here basic.
&13.12.11.10 .LONG 0D0C.0B0A ok
The inline colon format is also good for converting decimal to hex and so 13:12:11:10 works as well too:
13:12:11:10 .LONG 0D0C.0B0A ok
I've noticed that SPIPINS does make CLK and MISO outputs but not CE which used to be set manually but is now set automatically on any transfer and instead of manually releasing it you can just use the new SPICE instruction without parameters which will take CE high with the minimum of fuss.
Now that I am working with all my source files direct from dropbox you can load the latest EXTEND which includes making CE and output.
Just making sure I didn't forget something here basic with the SPIWR... words
Working on a driver for the MAX31856
here are two captures the first is test code to exercise pins and logic analyzer and the other one is a SPIWRB but I'm only seeing two clocks?
Latest Kernel and Extend
Can someone point me to an example or guide to "grafting" an existing PASM object (something like an OBEX item) with Tachyon?
Maybe an example is already in the codebase, but my searching/understanding skills weren't up to the task of finding it.
Thanks for the hard work and fun discussions here.
The current kernel fills up the entire image of the prop with just 33 longs left. In order to add a PASM object you must currently craft it into the kernel by removing other code. Peter was/is/maybe gonna create a generic way to take an existing PASM object, add some specific code to that PASM object so it could be "called" (loaded from SDCard) by the Tachyon kernel as necessary. I'm sure Peter will comment more soon.
What object are you trying to use with Tachyon?