SPI Plugin for Raspberry PI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SPI Plugin for Raspberry PI

Jon Hylands
 
Hi everyone,

I'm going to be upgrading one of my robots with a Raspberry PI, and I need it to talk to an Arduino over SPI (using level converters to switch from 3.3 to 5 volts). So, I need to write an SPI plugin, which I assume should be very similar (at least under linux) to the SerialPlugin.

I found this page: http://wiki.squeak.org/squeak/6102

Does it more or less describe the state of the art in terms of writing plugins?

Thanks,
Jon

Reply | Threaded
Open this post in threaded view
|

Re: SPI Plugin for Raspberry PI

timrowledge


On 29-03-2013, at 9:33 AM, Jon Hylands <[hidden email]> wrote:

> Hi everyone,
>
> I'm going to be upgrading one of my robots with a Raspberry PI, and I need it to talk to an Arduino over SPI (using level converters to switch from 3.3 to 5 volts). So, I need to write an SPI plugin, which I assume should be very similar (at least under linux) to the SerialPlugin.
>
> I found this page: http://wiki.squeak.org/squeak/6102
>
> Does it more or less describe the state of the art in terms of writing plugins?

Not quite. It completely ignores the SmartSyntaxInterpreterPlugin class and the plugins that are subclasses from it. It provides some much simpler syntax for handling the fetching of stack parameters and returning answers; take a look at FileCopyPlugin as a really trivial example.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- One saucer short of a tea-service.


Reply | Threaded
Open this post in threaded view
|

Re: SPI Plugin for Raspberry PI

David T. Lewis
 
On Fri, Mar 29, 2013 at 09:54:12AM -0700, tim Rowledge wrote:

>
>
> On 29-03-2013, at 9:33 AM, Jon Hylands <[hidden email]> wrote:
>
> > Hi everyone,
> >
> > I'm going to be upgrading one of my robots with a Raspberry PI, and I need it to talk to an Arduino over SPI (using level converters to switch from 3.3 to 5 volts). So, I need to write an SPI plugin, which I assume should be very similar (at least under linux) to the SerialPlugin.
> >
> > I found this page: http://wiki.squeak.org/squeak/6102
> >
> > Does it more or less describe the state of the art in terms of writing plugins?
>
> Not quite. It completely ignores the SmartSyntaxInterpreterPlugin class and the plugins that are subclasses from it. It provides some much simpler syntax for handling the fetching of stack parameters and returning answers; take a look at FileCopyPlugin as a really trivial example.
>

There are lots of plugins to look at for examples. Given that you expect
your plugin to be similar to SerialPlugin, you might want to just start
with a copy of that, delete all the stuff you don't want, and carry on
from there.

I'm assuming you are using a fairly recent Squeak image, and that you
are working on Linux, and that your main objective is to write a new
plugin that will work on Cog or interpreter VM. If that is the case,
I would suggest loading VMMaker from SqueakMap, which gives you the
development environment for an interpreter VM along with lots of plugins
that you can steal code from. The build procedure for Linux is simple
for an individual user, and the environment is convenient for writing
plugins because you can browse the generated C code as you work. The
resulting plugin will work identically when you compile it for Cog.

I'm pretty sure there has been discussion of Arduino interfaces before,
possibly on the Pharo list, so you may want to do some googling around
to see what's out there already.

Dave
 
Reply | Threaded
Open this post in threaded view
|

Re: SPI Plugin for Raspberry PI

Ken G. Brown

Arduino mentioned:
<http://gsoc2013.esug.org/ideas#h-54>

> The Arduino project for Pharo currently includes a set of core classes that allow you to communicate with an Arduino board.


Ken G. Brown

On 2013-03-29, at 12:37 PM, David T. Lewis wrote:

>
> On Fri, Mar 29, 2013 at 09:54:12AM -0700, tim Rowledge wrote:
>>
>>
>> On 29-03-2013, at 9:33 AM, Jon Hylands <[hidden email]> wrote:
>>
>>> Hi everyone,
>>>
>>> I'm going to be upgrading one of my robots with a Raspberry PI, and I need it to talk to an Arduino over SPI (using level converters to switch from 3.3 to 5 volts). So, I need to write an SPI plugin, which I assume should be very similar (at least under linux) to the SerialPlugin.
>>>
>>> I found this page: http://wiki.squeak.org/squeak/6102
>>>
>>> Does it more or less describe the state of the art in terms of writing plugins?
>>
>> Not quite. It completely ignores the SmartSyntaxInterpreterPlugin class and the plugins that are subclasses from it. It provides some much simpler syntax for handling the fetching of stack parameters and returning answers; take a look at FileCopyPlugin as a really trivial example.
>>
>
> There are lots of plugins to look at for examples. Given that you expect
> your plugin to be similar to SerialPlugin, you might want to just start
> with a copy of that, delete all the stuff you don't want, and carry on
> from there.
>
> I'm assuming you are using a fairly recent Squeak image, and that you
> are working on Linux, and that your main objective is to write a new
> plugin that will work on Cog or interpreter VM. If that is the case,
> I would suggest loading VMMaker from SqueakMap, which gives you the
> development environment for an interpreter VM along with lots of plugins
> that you can steal code from. The build procedure for Linux is simple
> for an individual user, and the environment is convenient for writing
> plugins because you can browse the generated C code as you work. The
> resulting plugin will work identically when you compile it for Cog.
>
> I'm pretty sure there has been discussion of Arduino interfaces before,
> possibly on the Pharo list, so you may want to do some googling around
> to see what's out there already.
>
> Dave
>

Reply | Threaded
Open this post in threaded view
|

Re: SPI Plugin for Raspberry PI

Ken G. Brown
In reply to this post by David T. Lewis

Further:
A few Arduino links I had saved that might be of interest:
<http://www.jarober.com/blog/blogView?entry=3461316488>
<http://www.jarober.com/blog/blogView?entry=3463724801>
<http://www.pjrc.com/teensy/td_libs_OneWire.html>

Ken

============
Arduino mentioned:
<http://gsoc2013.esug.org/ideas#h-54>

> The Arduino project for Pharo currently includes a set of core classes that allow you to communicate with an Arduino board.


Ken G. Brown

On 2013-03-29, at 12:37 PM, David T. Lewis wrote:

>
> On Fri, Mar 29, 2013 at 09:54:12AM -0700, tim Rowledge wrote:
>>
>>
>> On 29-03-2013, at 9:33 AM, Jon Hylands <[hidden email]> wrote:
>>
>>> Hi everyone,
>>>
>>> I'm going to be upgrading one of my robots with a Raspberry PI, and I need it to talk to an Arduino over SPI (using level converters to switch from 3.3 to 5 volts). So, I need to write an SPI plugin, which I assume should be very similar (at least under linux) to the SerialPlugin.
>>>
>>> I found this page: http://wiki.squeak.org/squeak/6102
>>>
>>> Does it more or less describe the state of the art in terms of writing plugins?
>>
>> Not quite. It completely ignores the SmartSyntaxInterpreterPlugin class and the plugins that are subclasses from it. It provides some much simpler syntax for handling the fetching of stack parameters and returning answers; take a look at FileCopyPlugin as a really trivial example.
>>
>
> There are lots of plugins to look at for examples. Given that you expect
> your plugin to be similar to SerialPlugin, you might want to just start
> with a copy of that, delete all the stuff you don't want, and carry on
> from there.
>
> I'm assuming you are using a fairly recent Squeak image, and that you
> are working on Linux, and that your main objective is to write a new
> plugin that will work on Cog or interpreter VM. If that is the case,
> I would suggest loading VMMaker from SqueakMap, which gives you the
> development environment for an interpreter VM along with lots of plugins
> that you can steal code from. The build procedure for Linux is simple
> for an individual user, and the environment is convenient for writing
> plugins because you can browse the generated C code as you work. The
> resulting plugin will work identically when you compile it for Cog.
>
> I'm pretty sure there has been discussion of Arduino interfaces before,
> possibly on the Pharo list, so you may want to do some googling around
> to see what's out there already.
>
> Dave
>