Skip to main content
Topic: Error in Bus Pirate Demo Board Code (Read 1271 times) previous topic - next topic

Error in Bus Pirate Demo Board Code

Hi Forum

I ordered 3 Bus Pirate Demo boards from Osh Park, thank you DP for making all the Eagle files downloadable!

After I built the boards, I wanted to test the I2C mode.
I plan to use the board and Bus Pirate as a teaching tool to show students how the I2C protocol works.

Unfortunately the board did not work.
After two days and willing to give up on it, I studied the source code and found the error inside the hardware.h file.

#define MODESPI      0x03 //0b11
#define MODEI2C      0x02 //0b10
#define MODEUART           0x01 //0b01
#define MODEUNK      0x00 //0b00

I2C mode should be entered with no jumpers set.
But when you look at the code the board enters spi mode,...
So either the code or the silkscreen is wrong.

After changing the code to
#define MODEI2C      0x03 //0b11
#define MODESPI      0x02 //0b10
#define MODEUART           0x01 //0b01
#define MODEUNK      0x00 //0b00
The problem was fixed, the board and the silkscreen match now.

That was a hard to catch error, because I was sure the board was tested and such a trivial error would have been caught sooner.
I also must confess I had no experience using Pic chips, I mostly use Msp430 controllers as teaching tool.

Nevertheless, all is well that ends well.
And it also was an interesting experience to work with a new uc.
I do not like the ide very much though,most annoying a double click should select a text instead of setting a break point.

Since I do not need all three pcbs I would give away one for free, just send me a p.m. if interested.

Cheers
Rubi

Re: Error in Bus Pirate Demo Board Code

Reply #1
IIRC there were several revisions of the PCB and also several revision of the silkscreen.

Thanks for catching the error!

Re: Error in Bus Pirate Demo Board Code

Reply #2
Hi Sjaak

No problem, I also added a led blinking sequence so you get a feedback about the mode setting.
1 blink I2C, 2 blink,...
I still have a problem although I changed the code, sometimes it still activates the spi engine.
I am afraid I have to debug this little bugger.

As far as teaching, I think I will order a version 4 board.
Although I first was really enthusiastic about your protocol emulator I think it is preferable to have a "real" chip where the students can also learn how to read a datasheet.

Thank you for your explanation.

Cheers
Rubi

 

Re: Error in Bus Pirate Demo Board Code

Reply #3
Hi

The promised board has a new owner.

Cheers
Rubi