Skip to main content
Topic: Adding a mode to the BP firmwate (Read 1345 times) previous topic - next topic

Adding a mode to the BP firmwate

Hi all, I'd like to try out writing some special feature mode to the bus pirate.

Now my coding skill is relatively limited, I mean I can read and write code...but that's about it. Since I am new to the Bus Pirate firmware It looks rather over whelming trying to figure out just the basic function calls.

The feature I would like to make is a PC-fan testing type thigie :)

simply put it should use the same basic PWM mode, with the added RPM, and Voltage measurement.
So you type in the frequency and duty cycle on AUX, and the BP reports back the RPMs (frequency of pulses in minutes) on AUX1. it should also report the voltage on the ADC pin as well.... ( I am building a PWM driven DC/DC converter that would drive the 3pin Fans, hence the-need for the voltage).

I guess this could be easy be implemented with a short script, but the whole point is that I would like to get familiar with the BP4 code, to get my baring straight so to speak.

So my question is how should I go around adding another mode to the bus pirate, ( this is just an exercise so I wont commit anything to the SVN, but I will release my code here). Any help at all will be much appreciated. Thanks
best regards FIlip.

Re: Adding a mode to the BP firmwate

Reply #1
I just copied dio.c and dio.h and searched 'BP_USE_DIO' and duplicated all that and added my own BP_USE_<modename> and it worked fine.

Just when you are at the spot when you are adding to the proto; you have to make sure any unused functions are using the write nullfunc1 nullfunc2... just copy them from the HiZ mode.

Re: Adding a mode to the BP firmwate

Reply #2
or you could hack the test features into the frequency generator command for testing. You can find that code in the auxpin.c file. That is how I'm prototyping the capacitor measurement feature.
Got a question? Please ask in the forum for the fastest answers.