Hello,
I
just got my Bus Pirate a couple days ago from SparkFun. I have
since read that there was some minor controversy over SparkFun creating
their own hardware version. I just wanted to add that I would
have probably never heard of the Bus Pirate or found
DangerousPrototypes if it wasn't for SparkFun selling their
version. Now that I'm here I'll probably end up getting a Logic
Sniffer too.
The first thing I tried to do with my Bus Pirate
was get a surplus LED display working. I had picked up the
alphanumeric display some time ago but never got around to playing with
it. This seemed like a reasonable first challenge. The Bus
Pirate and I would have to do some "real" work instead of just
reenacting a canned EEPROM demo. But it I thought it would be a
simple enough exercise to be accomplished in an evening. The
display uses a serial to parallel shift register and then the digits
are multiplexed. It must be sent a "packet" of five bytes
continuously to keep all the segments refreshed.
Using
the SPI mode I could easily send the five bytes needed to get one digit
at a time to light correctly. I was able to verify the display
hardware and my understanding of the digit and segment to bit
mapping. Next I wanted to try to see if I could get multiple
digits working. I read through the whole Bus Pirate documentation
Wiki and it appeared that the BASIC script engine would let me do what
I needed. I was planning to create a loop that would send the
seven five-byte packets repeatedly with time delays between each
packet.
I first discovered that the SEND command will
only accept a one byte argument and it must be in decimal
format. This is not very convenient but it is workable. I
was not yet sure how I was going to do the looping or the delays so I
just typed out all the send commands on lines
100-104,200-204,...,700-704. I am not at my development computer
now but I think the LIST command said it was 202 bytes.
On
to my problem. I typed RUN just to see if a "0" would rapidly
flash across all the digits in succession. And it did, more or
less. The display flickered with what looked like a zero on each
digit but it did not stop with the 7th digit light. The 5th digit
was the one still light. When I LIST'ed the program I found that
the lines were not in order! Each subgroup was in the correct
order, i.e. X00,X01,...,X04, but the groups themselves were not in
order. It went some thing like
100-104,300-304,...,700-704,...,500-504. This somewhat explained
why the fifth digit was the one that remained light.
Now
the bigger question is why are the lines out of order. When I
typed the lines in I typed them all in order,
100-104,200-204,...,700-704, all at one time so I know they are not
being listed in the order I typed them. Does anyone have any idea
what is going on?
I searched the forums and could not
find any threads about the BASIC script engine at all, let alone any
problems. It appears maybe not that many people use this feature
but I think could be very useful -- if it works. From what I have
read it seems a lot of people are using some scripting language on a
computer for more complex tasks instead on the internal BASIC
interpreter. In my case, I do not regularly use any scripting
language. It would take me longer to install, configure,
troubleshoot, learn, etc. a new scripting language to do some simple
development work than to just switch over to MPLAB and write a test
program in C natively for the PIC/dsPIC I normally use. The
built-in BASIC script engine however would be a very quick way to test
things a little to complex or burdensome to do by hand with the normal
Bus Pirate interface. I vote to keep it.
The Bus Pirate is
still plugged in with the BASIC program in memory. When I get
back to that computer I can provide actual listings or any other data
that may be useful. Thanks for making this project available and
for any help you can provide.
-Eric