... integer variable type (like the bbc b had)
... double variable type
INSTALL "MASS-STORAGE-USD" AS X USING CORE.DY
INPUT #S, HEADER AS STR, TIMEOUTPaul,The SolderCore hardware team (HardCORE?) have some suggestions:
Support for mass storage on the second SPI bus, the one routed to the headers, would be nice. I like the following syntax:INSTALL "MASS-STORAGE-USD" AS X USING CORE.DY
Where X would be the drive letter and Y is the pin number for the CS.
We could then put a uSD card into the SExI footprint and support up to 4 cards on the SenseCore.
A time out feature when reading from sockets would be handy. An optional extra parameter could be used to specify the timeout in seconds.INPUT #S, HEADER AS STR, TIMEOUT
On 6 Nov 2012, at 19:10, Iain <iain.de...@gmail.com> wrote:Paul,The SolderCore hardware team (HardCORE?) have some suggestions:The quality of these suggestions will be judged and marks awarded.
Support for mass storage on the second SPI bus, the one routed to the headers, would be nice. I like the following syntax:INSTALL "MASS-STORAGE-USD" AS X USING CORE.DYWhere X would be the drive letter and Y is the pin number for the CS.Do hardware engineers read software documents? No. ;-)
Did I not say how you would specify the second SPI bus in an earlier post? Oh yes, I did.
At present a number of shields have undocumented behaviour that allows additional micro SD cards to be added.My current line of attack is:
INSTALL "MASS-STORAGE-VOLUME DEV=/d" USING CORE.SPI(1), CORE.D22This mounts a mass storage volume, names it /d, tells the driver to use the internal SPI bus, and uses CORE.D22 as a select.6/10
We could then put a uSD card into the SExI footprint and support up to 4 cards on the SenseCore.INSTALL "SENSECORE" AS SENSEINSTALL "MASS-STORAGE-SD DEV=/a" USING CORE.SPI(0), SENSE.AThe second install explicitly states we would use the SPI bus routed to the Arduino headers. CORE.SPI(0), by definition, returns the SPI bus running to the headers, as it does on the Freedom Board. SENSE.A uses the Site A device select as the SD select.My long-term aim is to compete the soft UART, soft SPI, and soft I2C drivers. (Ok, the UART and I2C drivers are written, but you know, time required to wire them into CoreBASIC.) As such, any set of GPIOs could be turned into an SPI bus:INSTALL "SOFT-SPI" USING CORE.D0, CORE.D1, CORE.D2 ' SCK, MOSI, MISOIf you only needed to send data on MOSI:INSTALL "SOFT-SPI" USING CORE.D0, CORE.D1, CORE.NULLOne thing that you need to watch for is that after installation of the mass storage driver, editing your program will cause the /d device (for instance) to disappear all non-fixed drivers are finalised.Note that if you have four SD file systems mounted, there will be an additional memory requirement for the management data as well...7/10A time out feature when reading from sockets would be handy. An optional extra parameter could be used to specify the timeout in seconds.INPUT #S, HEADER AS STR, TIMEOUTYes, the syntax for this would need some modification. The timeout must come before the thing to input…INPUT #S; WAIT 10; HEADER AS STRThis inputs from stream (socket) S, specifies a maximum wait of 10 seconds, and then inputs a string to HEADER.I am not keen on adding more keywords because that trips up CoreBASIC users. However, there is a plethora of keywords in CoreBASIC (properties are no problem), and it's quite common to say (for instance)DATA = "Hello"
Of course, this is an error. Keeping the keyword space to a minimum is a good idea, hence the reuse of WAIT. Again, I'm not sure whether WAIT or PAUSE would be more appropriate.Artistic merit: 7/10, Execution: 3/10
Feel free to mark my modest hardware suggestions...
-- Paul.
On Tuesday, November 6, 2012 8:32:19 PM UTC, Paul Curtis wrote:The quality of these suggestions will be judged and marks awarded.Interesting... perhaps you should create a table. Winner after 3 months, gets a day with the you and a free device!
Where X would be the drive letter and Y is the pin number for the CS.Do hardware engineers read software documents? No. ;-)Wow. Brave comment.
Did I not say how you would specify the second SPI bus in an earlier post? Oh yes, I did.The HW team are ridiculously busy. We keep our eye our for HW related issues and leave SW to you.
This mounts a mass storage volume, names it /d, tells the driver to use the internal SPI bus, and uses CORE.D22 as a select.6/10Harsh!
I am not keen on adding more keywords because that trips up CoreBASIC users. However, there is a plethora of keywords in CoreBASIC (properties are no problem), and it's quite common to say (for instance)DATA = "Hello"zzZZZZ. How much more of this is there!? Surely your time would be better spent actually getting on with it.
Artistic merit: 7/10, Execution: 3/10I want a recount!
Feel free to mark my modest hardware suggestions...Hmm. As I've mentioned before choosing the colour of the solder mask is hardly a HW suggestion, certainly not one worthy of a grade...And no, you still can't have pink PCBs!
How about a config or autoexec file to auto setup things like net.timeserver, etc? Maybe add time zone correction too.
--
--
You received this message because you are subscribed to the Google
Groups "SolderCore" group http://groups.google.com/group/soldercore?hl=en
Hi Charles,There is an auto exec capability. In fact, there are no less than three files you'll find here:The CoreBASIC interpreter loads and runs the programs in the order/c/sys/!network.bas/c/sys/!boot.bas/c/!run.basThe first typically sets up the network for your particular situation (fixed IP/DHCP/node name). The second does whatever else is necessary after network configuration. The last is the user-level "autoexec" file.These files must contain programs, not immediate-mode commands.You can load each of these usingLOAD $NETLOAD $BOOTLOAD $RUNThe predefined constants $NET, $BOOT, and $RUN expand to the filenames above.
I would agree that TZ correction is something that CoreBASIC should offer. I am thinking that you would use:CORE.ZONE = -5 ' GMT-5I think whole hours is good enough.
On Sunday, November 11, 2012 4:17:45 PM UTC-7, CoreBASIC Wizard wrote:Hi Charles,There is an auto exec capability. In fact, there are no less than three files you'll find here:The CoreBASIC interpreter loads and runs the programs in the order/c/sys/!network.bas/c/sys/!boot.bas/c/!run.basThe first typically sets up the network for your particular situation (fixed IP/DHCP/node name). The second does whatever else is necessary after network configuration. The last is the user-level "autoexec" file.These files must contain programs, not immediate-mode commands.You can load each of these usingLOAD $NETLOAD $BOOTLOAD $RUNThe predefined constants $NET, $BOOT, and $RUN expand to the filenames above.Is that in the manual? I don't remember ever seeing those terms, but I do not have a great track record with the manual. LOL
Hi Charles,
Are you using pull-up resistors on the bus? The bus should time out, but if SCL is detected low, that is clock stretching. The underlying I2C code uses the I2C hardware and is interrupt driven. I will look into adding a timeout for non-response, but see if you have pull-ups…
-- Paul
--
10 ' I2C address scanner 20 ' reports only addresses that do not error 30 CLS 40 PRINT "Starting I2C address scan." 50 FOR I = 1 TO 255 60 TRY I2C I READ 1 TO X 70 IF NOT ERROR THEN PRINT "Found address: 0x"; HEX(I) 80 NEXT I 90 PRINT "Done."Hi Charles,
Good news about the pull-ups. :-)
The address scanner could do with a little modification. As the I2C statement uses an 8-bit address, what you’re really want is to step up in twos:
FOR I = 1 TO 255 STEP 2
CoreBASIC will adjust even addresses to odd addresses (lsb set) when requesting a READ anyway, so with the original code you will see two responses from the READ of the same device.
Secondly, address 0 is the “all stations” address, so you would need to start above that. And some station addresses are special (to indicate 10-bit or high speed addressing), so you would want to limit the range of addresses further.
7-bit addresses 0000xxx and 1111xxx are reserved for these purposes; hence 8-bit addresses 0000xxxx through 1111xxxx are reserved. So, to be completely pedantic you would need:
FOR I = 0x11 TO 0xEF STEP 2
However, very well done on the TRY! I can see you are reading the documentation. :-)
Regards,
-- Paul.
Charles,
You might want to output the same type of tabular form that i2ctools does, which Iain blogged about:
http://soldercore.com/sexi-beaglebone/
At some point I will find an I2C device with a 10-bit address and then will be able to write the code for it…
-- Paul.
Hello Paul,I know I did not follow protocol and it does report read and write address which I expected but it was quick and dirty. I was testing with multiple I2c devices and just wanted to verify the base address to make sure I had not changed them.Will change to your for loop.I have been doing my best to follow the book. ;-) Speaking of... Is there a bit shift command? Would be handy when reading LSB and MSB's from I2c registers.
How about a config or autoexec file to auto setup things like net.timeserver, etc? Maybe add time zone correction too.
How about some sort of file transfer like xmodem?Being able to update programs OTA can be very useful.
Hi Rob,
This is already done—mostly. I also want to support long file names on SD cards.
It seems rather perverse to store a program of, say, just a few tens of kilobytes, on a SD card that can store 4 or more gigabytes. J
There won’t be support for SDXC cards (i.e. >32GB); these look like they need dedicated hardware.
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
SolderCore Development Platform http://www.soldercore.com
--
I would like support for the one wire protocol please. No particular sensors in mind, just the basics read/write functions would be nice.
This is Dallas 1-wire? That’s possible, if you have the hardware configured for it. I think it’s a bit pants myself.
Could you add support for simple tone generation using the PWM enabled pins perhaps something like:
INSTALL "TONE-GENERATOR" using Dx as TONE1
INSTALL "TONE-GENERATOR" using Dy as TONE2
TONE1.PLAYL(NOTE, LEN)
TONE2.PLAYL(NOTE1, LEN1)
Hmm, simple BLEEPing.
Perhaps sequences could be stored in arrays... and played at specific tempo...hmm just thinking.
There’s a rich history of BASIC commands in this area.
Might be quite neat and would save me having to buy a MIDI module for my next blog.
You don’t need to purchase a MIDI module – you can purchase a Fluxamasynth or one of the VSxxx modules which support real time MIDI. These are amazingly inexpensive. I would recommend that over loading me up with more software tasks.
As discussed b4, support for asymmetric encryption would be nice, preferably a type that doesn't fall under export regulation...does such a thing exist?
The basis for RSA encryption is the simple operation a^e (mod m) where m is the modulus, e is the public exponent, and a is what you ‘d like to encrypt. Decryption uses the *same* operation, except you swap e for the private (decryption) exponent d. The asymmetry comes from the fact that the encryption key and decryption key are different. Typically e is a small prime, like 3, 65537. d is much, much larger. The security is based on the fact that it is hard to factor the modulus.
We have a big problem that general cryptographic mechanisms are subject to export control. Whilst it would be rather easy to add a modular exponentiation operation to CoreBASIC, that makes it an export-controlled item as the encryption is *general* and programmable.
Quite why governments think that export controlling encryption products will stop nasty people having access to encryption, I have no idea. You can download general purpose encryption/decryption off the web and run it on a GHz PC. Or put it in an FPGA. I don’t think a farm of SolderCores running RSA is going to worry the NSA or our government: too slow.
However, it is what it is, and RSA$ can be added to CoreBASIC but we would only be able to ship to places in the UK, and it would be a special build of CoreBASIC. And you’d need to be able to generate the public and private keys, which requires a primality test, so I’m not sure such a crypto toolkit is appropriate for CoreBASIC.
As discussed b4, support for asymmetric encryption would be nice, preferably a type that doesn't fall under export regulation...does such a thing exist?
No; the UK export regulations tell you all about key lengths and the requirements placed upon you for both symmetric and asymmetric encryption. We could export a DES-style thing, but it’s general purpose and can be converted to 3DES very easily with three applications of DES (using EDE mode) which then makes our device capable of general 3DES which is export controlled. Hence, offering just a simple DES encrypt/decrypt functionality means that we are export controlled.
So, as the author of CoreBASIC, you have what I decided to give you. Fantastic. Works well for me.Now, it's up to you to shake the tree and figure out what you want SolderCore or CoreBASIC to do for you that it doesn't do already. Within reason, of course.So, ideas here please...