Go to advanced search

by Steve Drain
Sun Feb 03, 2013 8:56 pm
Forum: RISCOS
Topic: Paralle data entry
Replies: 20
Views: 5036

Re: Paralle data entry

The IIC ports are written and read as bytes - that's pretty straightforward. The GPIO pin numbers are not sequential and the port addressing system is 'awkard', shall we say. As Tank suggests, you need to build the port from individual pins, but I do not think it is slow. With suitably designed tabl...
by Steve Drain
Sun Feb 03, 2013 8:28 pm
Forum: Automation, sensing and robotics
Topic: First Atempt at building a robot
Replies: 11
Views: 13240

Re: First Atempt at building a robot

These are being driven by one port on a MCP23017 GPIO expander... I started off using a downloaded GPIO module but this was bit orientated and causing a lot of performance overhead to drive the byte wise IO mapping I am using. As I also had to master I2C for the compass and display I ended up writi...
by Steve Drain
Sun Feb 03, 2013 1:33 pm
Forum: RISCOS
Topic: Paralle data entry
Replies: 20
Views: 5036

Re: Paralle data entry

Advice needed please: can the RPi (under RISC OS and BASIC) cater for parallel data entry ( eg by designating 8 GPIO lines as a parallel port) ? You cannot create a "parallel port" as such, but you can read/write the 8 lines as separate values. Tank was very kind in helping me understand the GP por...
by Steve Drain
Sun Feb 03, 2013 12:38 pm
Forum: RISCOS
Topic: RISC OS; Pros and Cons
Replies: 145
Views: 29831

Re: RISC OS; Pros and Cons

You do have me curious, I am going have to look at the source for BBC BASIC V and see what is making this difference Good luck with that. You might like to look at the BASIC StrongHelp manual ( http://www.kappa.me.uk/basic.htm ) that I maintain, which has a lot of detail about how BASIC works and u...
by Steve Drain
Fri Feb 01, 2013 3:55 pm
Forum: RISCOS
Topic: RISC OS; Pros and Cons
Replies: 145
Views: 29831

Re: RISC OS; Pros and Cons

Indeed. I said "Recursion is a concise and valuable technique" In your example I assume you were programming in C. Is it possible that the compiler reconizes the tail recursion and compiles as an iteration? That is the best of both worlds - clear code and optimised performance. We cannot do that in ...
by Steve Drain
Fri Feb 01, 2013 1:32 pm
Forum: RISCOS
Topic: RISC OS; Pros and Cons
Replies: 145
Views: 29831

Re: RISC OS; Pros and Cons

In the real world BASIC could be asked to something recursive (like Ackermann), so it's as valid a test as any other (we can't always just use algorithms that suit BASIC can we ?). Yes, we can, and should, when they do the same thing. Recursion is a concise and valuable technique, but it is not com...
by Steve Drain
Thu Jan 31, 2013 5:16 pm
Forum: RISCOS
Topic: RISC OS; Pros and Cons
Replies: 145
Views: 29831

Re: RISC OS; Pros and Cons

A quickly hacked out version of this takes 1.7sec on Squeak on my pi. At 1.7 seconds.. considerably faster. I wonder why.. is that compiled or interpreted Tim? A bit of adjustment to the BASIC leads to about the same time: DEFFNa(m%,n%) IF m% ELSE =n%+1 IF n% ELSE =FNa(m%-1,1) =FNa(m%-1,FNa(m%,n%-1...
by Steve Drain
Wed Jan 30, 2013 12:05 pm
Forum: RISCOS
Topic: RISC OS; Pros and Cons
Replies: 145
Views: 29831

Re: RISC OS; Pros and Cons

If - on the other hand - you wanted a bit more speed (and remembering this is an interpreter eliminating unnecessary spaces would probably help more (at the BASIC prompt ">" just type CRUNCH %11111). Ok it means the program is more difficult to read but should up the performance a tad ;-) BASIC V w...
by Steve Drain
Thu Jan 10, 2013 1:52 pm
Forum: General discussion
Topic: suggestion/thought: smaller form factor
Replies: 5
Views: 929

Re: suggestion/thought: smaller form factor

It might be nice to have raspberry pi's that can be thiinner, or optionally thinner. I know I am asking for the moon, but I would also like this. Looking back at the news item about the fabrication process at the S Wales plant I see that the fitting of the bulky USB, Video, Audio, GPIO and Network ...
by Steve Drain
Sat Dec 29, 2012 5:06 pm
Forum: RISCOS
Topic: BBC Basic compilable?
Replies: 33
Views: 11421

Re: BBC Basic compilable?

I'd prefer any final application ... to be a single, independently executable file which does not assume the presence of any other resource ... RISC OS is predicated on shared resources. If you ignore that you are just making trouble for yourself. Start simple, look at some applications, see how th...
by Steve Drain
Fri Dec 28, 2012 5:40 pm
Forum: RISCOS
Topic: BBC Basic compilable?
Replies: 33
Views: 11421

Re: BBC Basic compilable?

Sorry if this is a naive question, but can programs written in ARM variants of BBC BASIC be compiled to standalone executables which will run under Pi RISCOS like any other RISCOS utility? Although there are possible ways to compile ARM BBC BASIC, it is essentially an interpreted language. The inte...
by Steve Drain
Tue Nov 27, 2012 8:07 pm
Forum: RISCOS
Topic: I2C Access
Replies: 79
Views: 16935

Re: I2C Access

Sorry to poke my nose in, but I would not like inaccurate information about BASIC to go into the record. pygmy_giant is correct: %1 (binary) is identical to 1 and DIM Data% 3 reserves 4 bytes. I think Grump Mike has spotted one reason there might be a problem in that you are using a R/W bit of 1 in ...
by Steve Drain
Sun Nov 25, 2012 11:43 pm
Forum: RISCOS
Topic: I2C Access
Replies: 79
Views: 16935

Re: I2C Access

DIM Data% 0 I presume you mean DIM Data% 1 ? I have never used this command, but I would think it will put the data requested into the block you point to, so if the device returns more that 1 byte you will need to make the DIM bigger. DIM Data% 0 and DIM Data% 1 both actually reserve 4 bytes, but t...
by Steve Drain
Sun Nov 25, 2012 2:54 pm
Forum: RISCOS
Topic: I2C Access
Replies: 79
Views: 16935

Re: I2C Access

You have several options: GPIO_*I2C is a layer on top of IIC_Control/OS_IICOp, that issues the appropriate IIC commands for the MCP23017. If you have some other chip, you'll have to use the IIC SWIs yourself to drive it - GPIO_* is no help here. I have just released a slightly different approach to...
by Steve Drain
Mon Nov 19, 2012 10:49 am
Forum: RISCOS
Topic: RiscOS and GPIO for dummies ...
Replies: 48
Views: 14900

Re: RiscOS and GPIO for dummies ...

Question: Are you planning a 'RiscOS and GertBoard for dummies..."? I'm more than alittle intimidated by the code supplied eg #define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3)) . :shock: I saw that when writing my own GPIO support. It is a way to pre-calculate the bit position for a pin in ...
by Steve Drain
Thu Nov 15, 2012 12:57 pm
Forum: RISCOS
Topic: BBC BASIC & Rosetta Code
Replies: 21
Views: 4624

Re: BBC BASIC & Rosetta Code

To create a 'shared resource' in Windows one would have to make it a DLL. It is quite possible to make BASIC libraries a shared resource for any BASIC program in RISC OS. I wrote a module[1] to support that way back in the mists of time, but it was taken up by only a handful of programmers, who hav...
by Steve Drain
Wed Nov 14, 2012 11:24 pm
Forum: RISCOS
Topic: BBC BASIC & Rosetta Code
Replies: 21
Views: 4624

Re: BBC BASIC & Rosetta Code

A keyword written in machine code can be an order of magnitude or more faster and smaller than the equivalent BASIC code Faster I would of course believe, but smaller? In my experience tokenised and crunched BASIC code is usually more compact than the equivalent machine code. You might replace a ro...
by Steve Drain
Tue Nov 13, 2012 1:35 pm
Forum: RISCOS
Topic: BBC BASIC & Rosetta Code
Replies: 21
Views: 4624

Re: BBC BASIC & Rosetta Code

I have every respect for your technical achievements in Basalt, but it's taking BBC BASIC in a very different direction to that which I have been following, and goes against the philosophy of BBC BASIC as a 'lean and mean' language which I feel so strongly about and which I think was shared by Soph...
by Steve Drain
Sun Nov 11, 2012 8:56 pm
Forum: RISCOS
Topic: BBC BASIC & Rosetta Code
Replies: 21
Views: 4624

Re: BBC BASIC & Rosetta Code

As you know I am well aware of Basalt, and as a way of extending ARM BASIC without actually modifying the existing interpreter it is very clever. But ... To be brief, Basalt has dozens of function keywords. It has pointers to user-defined functions, although not as well integrated as BB4W. It has O...
by Steve Drain
Sun Nov 11, 2012 10:49 am
Forum: RISCOS
Topic: BBC BASIC & Rosetta Code
Replies: 21
Views: 4624

Re: BBC BASIC & Rosetta Code

It is a great shame that, despite the ongoing efforts by the likes of Jonathan Harston, ARM BBC BASIC still lags so far behind the specification of BB4W. As far as Rosetta Code tasks are concerned a large number simply could not be solved in ARM BASIC or Brandy. The BBC BASIC solutions (over 440 at...
by Steve Drain
Sat Nov 10, 2012 11:31 pm
Forum: RISCOS
Topic: BBC BASIC & Rosetta Code
Replies: 21
Views: 4624

Re: BBC BASIC & Rosetta Code

BBC Basic V and VI are the last official versions supplied with BBC branded Acorn computers. Any BB4W extensions used in Rosetta code make them non-BBC Basic and it is those examples that should be labelled as something other than BBC Basic! Sawdust. I am sure Richard will have something to say abo...
by Steve Drain
Sat Nov 10, 2012 3:45 pm
Forum: RISCOS
Topic: BBC BASIC & Rosetta Code
Replies: 21
Views: 4624

Re: BBC BASIC & Rosetta Code

Why isn't BASIC64 the default ('ROM') version on a machine with FP hardware? Presumably memory usage is a little greater, with floats needing 8 bytes each rather than 5, but are there any other reasons? Is the 64-bit version fully up-to-date with the later features such as DIM LOCAL? Presumably bec...
by Steve Drain
Fri Nov 02, 2012 6:41 pm
Forum: RISCOS
Topic: RISC OS released on Raspberry Pi
Replies: 133
Views: 29201

Re: RISC OS released on Raspberry Pi

In BASIC you can use R0 to R7 inclusive, though the routine can use R8 and R9 as well (according to RISC OS 3 PRM vol 1 p.23) The versions of BASIC you will find on the Pi allow R0 to R9 to be passed and returned. Note that any blank values (between commas or absent) are passed as 0. There is quite...
by Steve Drain
Thu Nov 01, 2012 8:42 pm
Forum: RISCOS
Topic: RISC OS released on Raspberry Pi
Replies: 133
Views: 29201

Re: RISC OS released on Raspberry Pi

I would like to acheive this via BASIC for nostalgic reasons, but if that's not possible I might revert to C. You can use BASIC with the IIC bus using SWI "OS_IICOp". If you go to the ROOL site and search for that name you will get all the detail. I wrote some test code in BASIC for the Ciseco Slic...
by Steve Drain
Tue Oct 30, 2012 11:08 pm
Forum: RISCOS
Topic: RISC OS released on Raspberry Pi
Replies: 133
Views: 29201

Re: RISC OS released on Raspberry Pi

Grumpy Mike wrote: To complete the list and the confusion:
?(address%+offset%)=val%
!(address%+offset%)=val%
works as well.
As I said, there are more things to find out about indirected variables, and that does not complete the list, yet. :)

Go to advanced search