Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - Eric

106
Bus Pirate Support / Re: Bus Pirate BASIC script engine problems
Below is the log from the terminal as I was entering the program.  I have cut out a few portions where I exited out of the BASIC interpreter to test a few things and then came back.  If needed I can paste the full log but here I tried to keep it to the relevant parts.

[tt:]Ready
SPI(BASIC)> 100 send 254
Ready
SPI(BASIC)> 101 send 0
Ready
SPI(BASIC)> 102 send 0
Ready
SPI(BASIC)> 103 send 2
Ready
SPI(BASIC)> 104 send 0
Ready
SPI(BASIC)> list

100  SEND 254
101  SEND 0
102  SEND 0
103  SEND 2
104  SEND 0
1000 END
65535  END
36 bytes.
Ready
SPI(BASIC)> run
Error(3) @line:1000 @pgmspace:33

Ready
SPI(BASIC)> 1000
Ready
SPI(BASIC)> list

100  SEND 254
101  SEND 0
102  SEND 0
103  SEND 2
104  SEND 0
65535  END
30 bytes.
Ready
SPI(BASIC)> run

Ready
SPI(BASIC)> run

Ready

SPI(BASIC)> list

100  SEND 254
101  SEND 0
102  SEND 0
103  SEND 2
104  SEND 0
65535  END
30 bytes.
Ready
SPI(BASIC)> 200 send 254
Ready
SPI(BASIC)> 201 send 0
Ready
SPI(BASIC)> 202 send 0
Ready
SPI(BASIC)> 203 send 1
Ready
SPI(BASIC)> 204 send 0
Ready
SPI(BASIC)> list

100  SEND 254
101  SEND 0
102  SEND 0
103  SEND 2
104  SEND 0
200  SEND 254
201  SEND 0
202  SEND 0
203  SEND 1
204  SEND 0
65535  END
57 bytes.
Ready
SPI(BASIC)> 300 send 254
Ready
SPI(BASIC)> 301 send 0
Ready
SPI(BASIC)> 302 send 0
Ready
SPI(BASIC)> 303 send 0
Ready
SPI(BASIC)> 304 send 128
Ready
SPI(BASIC)> 400 send 254
Ready
SPI(BASIC)> 401 send 0
Ready
SPI(BASIC)> 402 send 0
Ready
SPI(BASIC)> 403 send 0
Ready
SPI(BASIC)> 404 send 64
Ready
SPI(BASIC)> 500 send 254
Ready
SPI(BASIC)> 501 send 0
Ready
SPI(BASIC)> 502 send 0
Ready
SPI(BASIC)> 503 send 0
Ready
SPI(BASIC)> 504 send 32
Ready
SPI(BASIC)> 600 send 128
Ready
SPI(BASIC)> 601 send 1
Ready
SPI(BASIC)> 602 send 248
Ready
SPI(BASIC)> 603 send 0
Ready
SPI(BASIC)> 604 send 32
Ready
SPI(BASIC)> 700 send 128
Ready
SPI(BASIC)> 701 send 1
Ready
SPI(BASIC)> 702 send 248
Ready
SPI(BASIC)> 703 send 0
Ready
SPI(BASIC)> 704 send 32
Ready
SPI(BASIC)> list

300  SEND 254
301  SEND 0
302  SEND 0
303  SEND 0
304  SEND 128
600  SEND 128
601  SEND 1
602  SEND 248
603  SEND 0
604  SEND 32
100  SEND 254
101  SEND 0
102  SEND 0
103  SEND 2
104  SEND 0
400  SEND 254
401  SEND 0
402  SEND 0
403  SEND 0
404  SEND 64
700  SEND 128
701  SEND 1
702  SEND 248
703  SEND 0
704  SEND 32
200  SEND 254
201  SEND 0
202  SEND 0
203  SEND 1
204  SEND 0
500  SEND 254
501  SEND 0
502  SEND 0
503  SEND 0
504  SEND 32
65535  END
202 bytes.
Ready
SPI(BASIC)> run

Ready
SPI(BASIC)> run

Ready
SPI(BASIC)> exit[/tt:]

Here is the debug output.

[tt:]SPI(BASIC)> debug
0xE4 0x01 0x2C 0x93 0x32 0x35 0x34 0xE2 0x01 0x2D 0x93 0x30 0xE2 0x01 0x2E 0x93
0x30 0xE2 0x01 0x2F 0x93 0x30 0xE4 0x01 0x30 0x93 0x31 0x32 0x38 0xE4 0x02 0x58
0x93 0x31 0x32 0x38 0xE2 0x02 0x59 0x93 0x31 0xE4 0x02 0x5A 0x93 0x32 0x34 0x38
0xE2 0x02 0x5B 0x93 0x30 0xE3 0x02 0x5C 0x93 0x33 0x32 0xE4 0x00 0x64 0x93 0x32
0x35 0x34 0xE2 0x00 0x65 0x93 0x30 0xE2 0x00 0x66 0x93 0x30 0xE2 0x00 0x67 0x93
0x32 0xE2 0x00 0x68 0x93 0x30 0xE4 0x01 0x90 0x93 0x32 0x35 0x34 0xE2 0x01 0x91
0x93 0x30 0xE2 0x01 0x92 0x93 0x30 0xE2 0x01 0x93 0x93 0x30 0xE3 0x01 0x94 0x93
0x36 0x34 0xE4 0x02 0xBC 0x93 0x31 0x32 0x38 0xE2 0x02 0xBD 0x93 0x31 0xE4 0x02
0xBE 0x93 0x32 0x34 0x38 0xE2 0x02 0xBF 0x93 0x30 0xE3 0x02 0xC0 0x93 0x33 0x32
0xE4 0x00 0xC8 0x93 0x32 0x35 0x34 0xE2 0x00 0xC9 0x93 0x30 0xE2 0x00 0xCA 0x93
0x30 0xE2 0x00 0xCB 0x93 0x31 0xE2 0x00 0xCC 0x93 0x30 0xE4 0x01 0xF4 0x93 0x32
0x35 0x34 0xE2 0x01 0xF5 0x93 0x30 0xE2 0x01 0xF6 0x93 0x30 0xE2 0x01 0xF7 0x93
0x30 0xE3 0x01 0xF8 0x93 0x33 0x32 0xE1 0xFF 0xFF 0xA1 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Ready
SPI(BASIC)>[/tt:]

Here is the version information.

[tt:]SPI> i
Bus Pirate v3a
Firmware v5.7 (r478)  Bootloader v4.1
DEVID:0x0447 REVID:0x3043 (B5)
http://dangerousprototypes.com
CFG1:0xF9DF CFG2:0x3F7F
*----------*
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND     3.3V    5.0V    ADC     VPU     AUX     CLK     MOSI    CS      MISO
P       P       P       I       I       I       O       O       O       I
GND     3.30V   5.05V   0.00V   5.03V   L       L       L       H       H
Power supplies ON, Pull-up resistors ON, Open drain outputs (H=Hi-Z, L=GND)
MSB set: MOST sig bit first, Number of bits read/write: 8
a/A/@ controls AUX pin
SPI (spd ckp ske smp csl hiz)=( 2 0 1 0 1 1 )
*----------*
SPI>[/tt:]

Let me know if there is anything else useful I can provide.  I will try to hold off doing anything with the Bus Pirate for a while in case there is something you want me to test.  Thanks again.

-Eric
107
Bus Pirate Support / Re: Bus Pirate BASIC script engine problems
Sjaak,

Thanks for the reply.

Quote
One of those quirks to enter new before entering anything else entering line will fail.

I did enter the NEW command before I began.

Quote
Also it only accepts decimal values...

The decimal only issue is an inconvenience but not too hard to work around.  Having hex entry as well would be welcome if possible.

Quote
There is however some documentation about it in the wiki:

I had found and read through all of the Bus Pirate BASIC script reference page on the Wiki before I started.

Quote
...some sample scripts are in the development section of this board... written during the development...

I had not found the thread you linked, thank you.  I am not sure why search does not return that thread.  When I type "basic" in to the search box I only get one page of 16 results.  Interestingly, your reply to my post is listed but my original post is not.

Quote
please post the listing as currently in your buspirate, and if you got it a log of you entering it into the buspirate, and also a debug which should print out the programmemory as is. Also post the firmware version you are using. I'll look into it.

When I get to that computer I will post as much information as I can.

Thanks again.


-Eric
108
Bus Pirate Support / Bus Pirate BASIC script engine problems
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