Skip to main content
Topic: Bit Bang resolution / speed (Read 772 times) previous topic - next topic

Bit Bang resolution / speed

I've been playing with bitbang mode and I just wanted to check that my observations are correct and see if there is any way to improve performance...

It seems that the maximum speed of bitbanging is about 86.5uS - i.e. if I send a bulk command that switches a line HIGH/LOW as fast as possible, and then measure the output on a logic analyser, the size of the pulse will be approx. 86.5uS... This is actually good enough for my task in hand, but I was just curious if this can be improved, or is this a hardware/design limitation?

Apologies if this is a dumb question, but although I do a lot of work with microcontrollers, I'll admit up front that I'm really a software guy and don't get my hands too dirty with pic internals.... (I am code monkey. Chip monkey is not around at the moment!) :)

cheers,
Adam

 

Re: Bit Bang resolution / speed

Reply #1
Hi Adam,

The maximum bitbang mode speed just flips the pins up and down without any intentional delay. The delay is just a few clock cycles needed to load the next bit and put it on the pin. This could be made more efficient with carefully coded ASM or program restructuring, but we've already done most of the easy and 'lazy' improvements.
Got a question? Please ask in the forum for the fastest answers.