Bit Banging


#1

Hi All,

I wonder what’s the best technique for bit banging.
And what is the maximum speed for it.
I want to use it to communicate the SNAP PAC with a proprietary device via Manchester protocol.

Thank you,

Jan.


#2

Hi jdgeest,

Welcome to the forums!

Manchester protocol… wow, thats going back a ways…
Cool!

My first question is this;
Do you want to send it, or decode it (ie, receive it)??

If you want to send it, then its pretty much down to the speed of the digital output module you pick.
If you want to receive it, then its pretty much down to the speed of the digital input module you pick. (Hint, the SNAP-IDC5-FAST is one of our quickest).

Can you tell us a little more about your project… I’m always interested in these things and sometimes, with a little more info, we might be able to come up with a slightly different method to getting the job done.

Cheers,

Ben.


#3

Thanks Ben for your swift reply.

As you mentioned i want to send and receive over a 2 wire link.
The clock frequency is 10kHz.
So each bit takes 100 µs and consists of a transistion from 0 to 1 for a High bit (1.8Vmin to 3.6Vmax) and from 1 to 0 for a Low bit.
This means, if i want to check the level in the middle of each state, i need a resolution of 25µs.
A data frame consists of a <preamble><cmd><addr><data[15:8]><data[7:0]><crc><eof>
Before and after the frame the line is idle (Low).
Immediatly after the frame is sent, the remote device responds with a similar frame.

I looked at the SNAP-IDC5-FAST and this could maybe work for the receiving part.
But for transmitting, the specifations of the digital outputs are 0.5 cycle maximum.
What does this mean in absolute values?

Unfortunatly i guess, it’s not possible to use a RS485 module due the mandatory Stop bit after each byte.

Is there somewhere any code available that do this kind of job?

Thanks !

Jan.


#4

Because our gear is meant for industrial control, its got some ‘snubber’ circuitry on the output.
The roll of this snubber is to limit the damage a noisy relay or device can cause to the module.

The upside of this is that we can offer lifetime warranties on most of our modules.
The downside is never really an issue, till you get to bit banging serial data from a digital module… it makes them a little slower than something like a pure digital output.

So, I think it might be best to move from the idea of bit banging using a digital module to what we need to do it right, use a converter that will allow us to use a faster protocol.
This PDF might be worth a read.

Failing that, you might need to look at using some middle hardware to convert and buffer.

In other words, given the clock frequency you mention, we need to look at using the right tool for the job.

Ben


#5

Thanks for your reply Ben.

Your comments in mind, I’m going to use an AVR microcontroller.
This has serial communication wich can connect to the SNAP and I/O for the Manchester protocol.

Thanks again and best regards,

Jan.