I've updated EXTEND.FTH with *SCL and *SDA using $7E and $7F REG addresses. This places them at the end of the 128 bytes so you only have to worry about allocating 128 bytes for each instance of a Tachyon cog.
However there seems to be a problem and while I like to fix it tonight, I'm just really bushed and I will have to try again in the morning since I am obviously making mistakes here.
Hi Paul, I've updated EXTEND.FTH and I will get around to updating the binary as well shortly.
Just specify I2CPINS at the start of your cog's task and you can also specify the speed if necessary.
Remember that you can paste or send Forth code into the terminal with only 3ms line delay. No need to go slow.
Yes, that's the idea. I noticed that the previous I2C routines had a bug in assigning new pins. Sure enough, you could assign new pins but @SDA was a fixed constant, so it would have failed. This was done at the time to make it faster but a MASK operation does not push or pop the stack so it is very fast and so it is just as good to say *SDA MASK than it was to say "@SDA".
I checked the register usage and those last few bytes from $7A in the first 128 bytes are free.
snippet from the listing.
0038(0076) | padwr res 1 ' write index (builds characters down from lsb to msb in MODULO style)
0038(0077) | res 1
0038(0078) | undef res 2 ' undefined word exception vector
0038(007A) 00 | byte 0[$200-$38]
0200(00EC) | org
0200(0000) 00 00 | word 0
Peter,
I just downloaded the latest binaries from sourceforge. I went to install them and discovered that the QS board where I was going to install was defective, not your problem. The question I have is how do I download a .Spin driver that runs in another cog? I want to try avsa's NRF24L01 driver and communicate between two QS props with it. The second question I have is how do I get permissions to log onto the tychon forum on Sourceforge? I was going to pose this question on the forum there but was blocked.
Jim
Hi Jim, Look at the top of the page over to the right for "Create" to create an account at Sourceforge. You can go to the discussion link and create a new topic then and post. In the process of checking my settings I have also created a Tachyon for P1 and a TAQOZ for P2 forum as well.
I will look at that Spin driver because if it is mostly PASM we can compile it as a hex file that we can load into upper EEPROM anytime as a "ROM". Then at runtime you can load a ROM by name into a cog. You would also have some minimal application "hooks" at the Forth level to interface to this cog.
However, I have written some nRF24L01 stuff in Tachyon, mainly for sniffing wireless keyboards. So I guess I could look at that chip and see if I can come up with something useful, for you and me, for Tachyon, and for TAQOZ!
Peter,
That is great! The actual driver is spin and I am sure the hooks would be easy in tachyon.
A direct tachyon driver would also be super. Maybe it would be easier to just do in Tachyon.
Thanks.
Jim
edit changed pasm to spin
I was reminded about the Parallax Propeller font that is built into the P1 ROM and it's suitability for the P2 as well. I decided to write a one-liner to extract the font in table ready format to paste into TAQOZ. However, along the way I wanted to check what I was reading and made a quick little driver that "draws" the big font on the terminal screen. This is what happens when I type:
BIG ." Hello World" CON
byte xp
pub .FONT DUP 2/ 7 << $8000 + FROM 4 BY
( ch ) 32 FOR I @ OVER 1 AND IF 2/ THEN CR 9 xp C@ 2* EMITS 16 FOR DUP 1 AND " *" + C@ EMIT 2/ 2/ NEXT DROP NEXT DROP xp C++ ;
pub BIGEMIT uemit W~ HOME >B .FONT
pri BIG! ' BIGEMIT uemit W! ;
pub BIG xp C~ BIG! HOME ;
@RS_Jim - I've been a bit sidetracked getting software and hardware together for my latest P2D2s and so I still have to try out those nRF24L01 modules soon. Maybe I will do this on the P2 first and then port it back to the P1.
Peter,
Thanks for the reply. I am looking forward to the rfl driver. I am glad you bumped this thread, as I was going to bump it to make it easier for rsideaka to find, as he was inquiring about the P1 dictionary in another thread.
Jim.
Yes, you have no SD card! What you need to do is setup the pins that you have the SD card on. For instance if you are using a Prop activity board then you would enter this:
&25.22.24.23 SDPINS
This automatically backs up the pin settings to the EEPROM for next time, and now you are ready to mount.
If you have a custom board then simply enter the 4 pin numbers in that format and in this order: &<CardSelect>.<CardDataOut>.<CardDataIn>.<CardClock>
Practically all settings for Tachyon are configurable at runtime, so there is no need to recompile on the PC. The only exception is if you have a crystal other than 5 or 10MHz, and then you need to PC compile with your clock setting.
btw: the default setting is normally for one of my boards, in this case it is probably the P8 that is also used with the IoT5500.
You can FORGET EASYFILE and it will forget up to that point including everything that might have been added after it but normally there is no need to remove it as there is plenty of memory for your code. So I'd recommend leaving it there, because if you start forgetting things, you mightn't know what you're doing!
There are just so many things packed into Tachyon as standard, and EASYFILE is one of them, although it is added after EXTEND. Is there any particular reason you might have? BTW, which board is it and what are you looking at doing?
Hi Peter,
The board I am using is a Parallax 32212 proto board that I am going to set up with an NRF24L01 and an 8 channel ADC. The Idea is to connect two Joy sticks and use it for a Robot control. I probably will not run out of program space but I just wanted to know if there was a way to gain some.
Jim
SD card issue - I have the same problem as MJB had back in June 2019 ( no fix was discussed ). An sd card is reported as 0 bytes with 0kb clusters. Any clues on how to fix would be appreciated, so I can read files properly etc. What card brand / capacity / cluster size is a known worker please?
Which suggests the interface pins are connected OK. I have a 10k pullup on DO, DI but not SCLK and CS - just copied a circuit I found.
The sdhc card was purchased from Wilko in the town centre yesterday. It's a high speed microSDHC 16gb card formatted fat32 branded 'Integral' and marked class 10 microsd up to 90 Mb/s read speed. It was formatted using the 'SD Card formatter' application with a 32k cluster. Windows 7 reports it is FAT32. I put some .txt files on on it as a test.
The tachyon system was obtained from Peter's dropbox yesterday, and 'extend' and 'easyfile' were added to it from the same source.
All chips are decoupled, sdhc wires are very short, supply is checked 3.3V, nothing is hot. Crystal on the P1 is 5MHz, eeprom is a 24lc512. Tachyon will run a soak test reliably over the bluetooth link at the default 115200 baud. ( : SOAK BEGIN WORDS KEY UNTIL ; )
The card info looks correct and certainly you can access it.
CARD: SA16G TM02.55 #DD6D.7C29 2019/5 !C0FF.80C7 14,056us
The fact that you used the proper formatter would seem that it would indeed be FAT32.
Now if only I had the disk utilities for the P1 that I do for the P2. I will fire up a Tachyon system and see what I can do in the way of utilities to dig a bit deeper.
It's a mystery.
But the obvious question is: Have you tried this with a Sandisk or some other card?
Looking at your photo though, while the board looks well laid out, I don't like the look of those bypass caps, and unless I'm mistaken these film polys, like a lot of those larger styles they are not terribly good for much above audio frequencies. You need ceramics at least plus a small 10uF tantalum up that end. I've got no idea what the wiring looks like underneath but I normally strip and solder wire-wrap and also run a bare wire as a ground bus. I have even used the stick-on copper tape for this too.
tip: you could try slowing down the Prop just to see if the SD responds properly. That way you know it is to do with speed and current etc.
The card info looks correct and certainly you can access it.
CARD: SA16G TM02.55 #DD6D.7C29 2019/5 !C0FF.80C7 14,056us
The fact that you used the proper formatter would seem that it would indeed be FAT32.
Now if only I had the disk utilities for the P1 that I do for the P2. I will fire up a Tachyon system and see what I can do in the way of utilities to dig a bit deeper.
It's a mystery.
...
If you make new tools for Tachyon I will give it another try.
BTW, I was using proper boards PropBOE and IoT5500+P8
Would be nice if not only SanDisk would work
Thanks for the hints, chaps. I've used wirewrap wire too. I'll put in a few cross-bonds to beef up 0v somewhat, as this is an 80MHz cpu after all. The caps are disc ceramics, they're just molded ones.
OK on the Sandisk tip, I'll nip out and get a low capacity card from Curry's computer shop as they're useful anyway. Thought I'd ask before putting the scope on it.
OK, buying a Sandisk card seems to have fixed my problem, Tachyon recognised this 32Gb Sandisk microSDHC card straight of the box. I just renamed it and get the following responses:-
I have had some problems with various rebranded noname cards and while they work in the PC, that is probably more to do with 4-bit SD mode vs the 1-bit SPI mode. The SD spec says what should be supported but noname will do what noname will do, they are not worried about not test SPI mode I'm sure.
Besides, Sandisk cards with the A1 logo (the standard card these days) perform better since this type has lower latency because it is optimized for phones, rather than cameras which just write one large file and move on to the next.
But hang on to that card because when you get a P2 board you can load TAQOZ and get it to do a full report (or maybe it will just work).
Yes, this P1 is just a warm-up to explore Tachyon, before the P2. I have a little bag of old sd cards, so the 'Wilko' card will go in there for a while. Thanks again.
Yes Dave, I'm a retired electronics engineer and radio ham 10m E of Bath - I nipped into Wilkinsons's yesterday, thinking their sd cards would surely do for this Tachyon project - alas no. One good thing is that others will be aware of the issue - not a big expense these days either.
Using Tachyon V5r7 NEON 570190926.2300, I would like to change the terminal baud rate from 115200. Tried 3000000 CONBAUD <enter> and then pressed the reset button. Tachyon reboots but the terminal is still 115200 baud.
I notice that the value of CLOCKFREQ / baudrate is written to $28 in RAM and EEPROM. I can read those values both changing. Tried a couple of different baud rates, still apparently ignored
Using Tachyon V5r7 NEON 570190926.2300, I would like to change the terminal baud rate from 115200. Tried 3000000 CONBAUD <enter> and then pressed the reset button. Tachyon reboots but the terminal is still 115200 baud.
I notice that the value of CLOCKFREQ / baudrate is written to $28 in RAM and EEPROM. I can read those values both changing. Tried a couple of different baud rates, still apparently ignored
have I missed something?
Not sure since I use this all the time but normally I don't go above 2M as 3M can be a bit edgy plus there is 0% baud rate error for 80M/2M. Read EEPROM and just make sure that it has written.
@bob_g4bby - That was very strange when I tried it and it didn't work. Had a closer look and looks like I must have made a change to CONBAUD but used $28 instead of $18. Patched that and now it works.
Nice one Peter, thanks for finding that. I want to experiment with passing arrays of data to and from LabView in Windows at audio rate, to test out dsp words on the P1. If I can get the baud rate high enough that can be in real time, so I can hear as well as graph the results. OK on checking the stability of the link and that 3Mbaud may not be possible.
3Mbaud is physically possible with a P1 and the usual FTDI converter, but if you're constantly blasting data, some will go missing. It also helps to mess with the receive buffer sizes in the COM port's device manager property window thing
Comments
However there seems to be a problem and while I like to fix it tonight, I'm just really bushed and I will have to try again in the morning since I am obviously making mistakes here.
Cheers!
Just specify I2CPINS at the start of your cog's task and you can also specify the speed if necessary.
Remember that you can paste or send Forth code into the terminal with only 3ms line delay. No need to go slow.
What about i2cflg? Should it be in the task register block as well ? $7D ?
I checked the register usage and those last few bytes from $7A in the first 128 bytes are free.
snippet from the listing.
I just downloaded the latest binaries from sourceforge. I went to install them and discovered that the QS board where I was going to install was defective, not your problem. The question I have is how do I download a .Spin driver that runs in another cog? I want to try avsa's NRF24L01 driver and communicate between two QS props with it. The second question I have is how do I get permissions to log onto the tychon forum on Sourceforge? I was going to pose this question on the forum there but was blocked.
Jim
I will look at that Spin driver because if it is mostly PASM we can compile it as a hex file that we can load into upper EEPROM anytime as a "ROM". Then at runtime you can load a ROM by name into a cog. You would also have some minimal application "hooks" at the Forth level to interface to this cog.
However, I have written some nRF24L01 stuff in Tachyon, mainly for sniffing wireless keyboards. So I guess I could look at that chip and see if I can come up with something useful, for you and me, for Tachyon, and for TAQOZ!
That is great! The actual driver is spin and I am sure the hooks would be easy in tachyon.
A direct tachyon driver would also be super. Maybe it would be easier to just do in Tachyon.
Thanks.
Jim
edit changed pasm to spin
@RS_Jim - I've been a bit sidetracked getting software and hardware together for my latest P2D2s and so I still have to try out those nRF24L01 modules soon. Maybe I will do this on the P2 first and then port it back to the P1.
Thanks for the reply. I am looking forward to the rfl driver. I am glad you bumped this thread, as I was going to bump it to make it easier for rsideaka to find, as he was inquiring about the P1 dictionary in another thread.
Jim.
I just put the latest TF5 on a proto board and get this note on start
“Mon, 01 Jan 2001 00:00:00 UTC *Card Error*”
Is it because there is no SD card?
Jim
If you have a custom board then simply enter the 4 pin numbers in that format and in this order: &<CardSelect>.<CardDataOut>.<CardDataIn>.<CardClock>
Practically all settings for Tachyon are configurable at runtime, so there is no need to recompile on the PC. The only exception is if you have a crystal other than 5 or 10MHz, and then you need to PC compile with your clock setting.
btw: the default setting is normally for one of my boards, in this case it is probably the P8 that is also used with the IoT5500.
Jim
There are just so many things packed into Tachyon as standard, and EASYFILE is one of them, although it is added after EXTEND. Is there any particular reason you might have? BTW, which board is it and what are you looking at doing?
The board I am using is a Parallax 32212 proto board that I am going to set up with an NRF24L01 and an 8 channel ADC. The Idea is to connect two Joy sticks and use it for a Robot control. I probably will not run out of program space but I just wanted to know if there was a way to gain some.
Jim
The lines above appear on P1 reset and also after inserting an sdhc card.
So, copying what MJB did, the directory reads:-
Which suggests the interface pins are connected OK. I have a 10k pullup on DO, DI but not SCLK and CS - just copied a circuit I found.
The sdhc card was purchased from Wilko in the town centre yesterday. It's a high speed microSDHC 16gb card formatted fat32 branded 'Integral' and marked class 10 microsd up to 90 Mb/s read speed. It was formatted using the 'SD Card formatter' application with a 32k cluster. Windows 7 reports it is FAT32. I put some .txt files on on it as a test.
The tachyon system was obtained from Peter's dropbox yesterday, and 'extend' and 'easyfile' were added to it from the same source.
All chips are decoupled, sdhc wires are very short, supply is checked 3.3V, nothing is hot. Crystal on the P1 is 5MHz, eeprom is a 24lc512. Tachyon will run a soak test reliably over the bluetooth link at the default 115200 baud. ( : SOAK BEGIN WORDS KEY UNTIL ; )
CARD: SA16G TM02.55 #DD6D.7C29 2019/5 !C0FF.80C7 14,056us
The fact that you used the proper formatter would seem that it would indeed be FAT32.
Now if only I had the disk utilities for the P1 that I do for the P2. I will fire up a Tachyon system and see what I can do in the way of utilities to dig a bit deeper.
It's a mystery.
But the obvious question is: Have you tried this with a Sandisk or some other card?
Looking at your photo though, while the board looks well laid out, I don't like the look of those bypass caps, and unless I'm mistaken these film polys, like a lot of those larger styles they are not terribly good for much above audio frequencies. You need ceramics at least plus a small 10uF tantalum up that end. I've got no idea what the wiring looks like underneath but I normally strip and solder wire-wrap and also run a bare wire as a ground bus. I have even used the stick-on copper tape for this too.
tip: you could try slowing down the Prop just to see if the SD responds properly. That way you know it is to do with speed and current etc.
If you make new tools for Tachyon I will give it another try.
BTW, I was using proper boards PropBOE and IoT5500+P8
Would be nice if not only SanDisk would work
OK on the Sandisk tip, I'll nip out and get a low capacity card from Curry's computer shop as they're useful anyway. Thought I'd ask before putting the scope on it.
I'll set up a read soak test and see if that's reliable.
Besides, Sandisk cards with the A1 logo (the standard card these days) perform better since this type has lower latency because it is optimized for phones, rather than cameras which just write one large file and move on to the next.
But hang on to that card because when you get a P2 board you can load TAQOZ and get it to do a full report (or maybe it will just work).
Did you say 'Wilko card'
Does that mean you are from the UK?
Dave
Using Tachyon V5r7 NEON 570190926.2300, I would like to change the terminal baud rate from 115200. Tried 3000000 CONBAUD <enter> and then pressed the reset button. Tachyon reboots but the terminal is still 115200 baud.
I notice that the value of CLOCKFREQ / baudrate is written to $28 in RAM and EEPROM. I can read those values both changing. Tried a couple of different baud rates, still apparently ignored
have I missed something?
Not sure since I use this all the time but normally I don't go above 2M as 3M can be a bit edgy plus there is 0% baud rate error for 80M/2M. Read EEPROM and just make sure that it has written.