Biffboot Easter-egg

9 views
Skip to first unread message

biff...@yahoo.co.uk

unread,
Jan 23, 2010, 2:50:41 PM1/23/10
to Bifferboard

As part of my ongoing Propeller investigations [1], I realised it
would be handy to add some GPIO capability to my laptop. Then I
remembered some undocumented code I put in Biffboot back when I was
first working on the network version, so I think it's been there as
long as the network console, i.e. most Biffboot v2.X users should have
it.

There is some demo code in SVN to exploit this:
http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/files/boot/bb_eth_gpio.py

Run the script with the 'connect' argument, then switch on the board -
it should connect to the board, then you can issue various GPIO
commands (example given to switch the red LED on and off).

An alternative is the GPIO-proxy service I wrote a while back, which
is perhaps a more elegant way of doing this, but this works without
flashing a new kernel, rootfs and so on, so is very quick to setup.

Hope you find it useful,
Biff.

[1] http://sites.google.com/site/bifferboard/Home/howto/serial-terminal-project/parallax-propeller-investigation

Andrew Scheller

unread,
Feb 7, 2010, 8:51:27 PM2/7/10
to biffe...@googlegroups.com
> first working on the network version, so I think it's been there as
> long as the network console, i.e. most Biffboot v2.X users should have

I've just tried this with BiffBoot 2.9 on a 2-port BB...

> There is some demo code in SVN to exploit this:
> http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/files/boot/bb_eth_gpio.py
>
> Run the script with the 'connect' argument, then switch on the board -
> it should connect to the board, then you can issue various GPIO
> commands (example given to switch the red LED on and off).

I can confirm that the sequence:
bb_eth_gpio ..... connect
bb_eth_gpio ..... out_low 16
bb_eth_gpio ..... out_high 16
turns the GPIO-LED on and off, but how do I read the button state?

I tried
bb_eth_gpio ..... read 15
but that prints 'OK 0 0 0' regardless of whether the button is pressed or not.
So I tried
bb_eth_gpio ..... in 15
bb_eth_gpio ..... read 15
(clutching at straws here!) but I still get 'OK 0 0 0' no matter if
the button's pressed or released.

And what's the difference between 'out_low' + 'out_high' and 'low' + 'high' ?

Lurch

Andrew Scheller

unread,
Feb 7, 2010, 9:39:23 PM2/7/10
to biffe...@googlegroups.com
>> first working on the network version, so I think it's been there as
>> long as the network console, i.e. most Biffboot v2.X users should have
> I've just tried this with BiffBoot 2.9 on a 2-port BB...

...and now on BiffBoot2.1 on a 1-port BB...

> I can confirm that the sequence:
> bb_eth_gpio ..... connect
> bb_eth_gpio ..... out_low 16
> bb_eth_gpio ..... out_high 16
> turns the GPIO-LED on and off,

This works on BiffBoot 2.1 too

> but how do I read the button state?

And this now works on BiffBoot2.1!!!
On BB2.9 the second number after the OK is always 0 (for 'out_low'
'out_high' and 'read') but on BB2.1 the second number after the OK is
always 1<<(GPIO number) i.e. 65536 for 'out_low 16' and 32768 for
'read 15'.
The 'in 15' isn't necessary, but it seems the *first* read of GPIO15
is always 0, whether or not the button is pressed. The second and
subsequent GPIO15 reads do work correctly though - "OK 0 32768 1" if
the button is released and "OK 0 32768 0" if the button is pressed.

Lurch

Reply all
Reply to author
Forward
0 new messages