Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Barker Code Generator

Status
Not open for further replies.

JamesIbox

Electrical
Jul 21, 2005
5
Hello,

I am looking for a _simple_ circuit to generate a Barker code sequence (11101101, if I remember correctly). I was thinking of using a PIC10F200 to do this, but I feel that the PIC is a little "overkill" for this application.

Do you know any logic circuit or any alternative method to generate such sequence? Thank you in advance!

Best regards,
James
 
Replies continue below

Recommended for you

If it's a fixed sequence, why can't you hardcode that into a synchronously loaded shift register?

TTFN



 
To expound on IRstuff's suggestion you just take a nonvolitle memory of some sort load it up with your data, tie it's RD pin somewhere. Then run a shift register into the address pins so the memory sequentially spews your data.

It is used all the time for stuff; like my Direct Synthesis Signal Generator.
 
Thank you both of you for your quick response! Would you please tell me which synchronously loaded shift register is appropriate for this? I am a little dim right now as I haven't touch the digital stuff for a while. Thanks!
Best regards,
James
 
I believe that the longest (optimal) Barker code is 13 bits long. There are shorter ones, but apparently no longer ones.

(I've never understood why Barker Codes aren't used 'everywhere'.)

 
In answer to the original question, it could certainly be done using several TTL chips, but it might be cheaper, smaller, lower power, more reliable, easier to get parts, better in all respects - to simply use a small 8-pin uP (or something similar).

Barker Code info:
 
Barker codes are essentially designed for error correction through the use of spread spectrum; but without the need for mathematical error correction. It's VERY expensive due to the need for the extra bandwidth and unnecessary if you don't have that noisy a channel. The code eeffectively provides multiple error correction on a bitwise basis.

If you don't have that noisy a channel, then any simple error correcting code will be more efficient from total data bandwidth.

A simple 8 bit ECC on 64 bits is only 12.5% more data bandwidth required, while a 13-bit Barker code is 1300% more data bandwidth required.



TTFN



 
I don't believe that Barker Codes are designed for 'error correction' (in the manner of more modern codes); they're designed to add-up without any 'sidelobes' (spurious responses in the time domain) greater than +/- 1 even as they're being shifted into the Barker Code summation matrix.

The definition of Barker Codes includes this 'sidelobe' characteristic. There's only a handful of codes that have this characteristic and the longest is 13-bits in length.

The first time that I met them was in a radar system where they're used to peak-up (by 13:1) the return thus improving SNR.

If your signal is relatively low bandwidth, then making it slightly wider with a Barker Code is free.

Apologies for disagreeing again...
 
"improving SNR" is essentially analog error correction.

TTFN



 
"improving SNR" is perhaps analog error *prevention*.

;-)
 
Your PIC solution, as you first suggested, may be "best" if you are familiiar with the part. The cost should be on par with PAL. Unless you have other circuits involved in your entire project that could do some of the work. The longest Barker is 5, 2, 2, 1, 1, 1, 1, or 1 1 1 1 1 0 0 1 1 0 1 0 1. It would be interesting why you would need specifically a Barker code. If Barker is your only requirement, you could use all 0's, which is the first Barker code, or a clock, which is the seconde Barker code. However, it is generaly considered that "the" Barker code is the length 13. It can be forward or backward.
IRstuff first mentioned the pre-loaded shift register. That is simpler than a PIC, but might not cost much less.
 
Thank you everyone for your inputs. I think I will go with the MCU solution as I am more familiar with it and it doesn't take much real estate. The PIC10F200 costs about $0.25 USD each and the Toshiba 86C405 costs about $0.13 USD each (is "cost" a verb?)

Anyway, I am having some troubles connecting the PIC10F200 to ICD 2 now. I got these messages:

Programming Target...
ICDWarn0044: Target has an invalid calibration memory value (0x400). Continue?
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x22)
...Loading DebugExecutive
Verifying...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0xA01, Val Read = 0x0)
ICD0275: Programming failed.
MPLAB ICD 2 Ready

I read somewhere that I need to apply 12V at Vpp. I did that but it made no difference. The CP bit is always turned off:
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF

Any other idea?

James
 
You would have to read the programming spec for that specific chip, but you may need to modulate the Vpp and/or do multiple resets throughout the programming process. Early PICs were easy enough... bring Vpp up to 13V, send in clock/data, and be done with it. Some of the more recent varieties ('A series parts?) tend to require a little more complicated programming process.

Make sure you have the correct chip selected (also check that your programmer supports that chip).


Dan
Owner
 
Thank you everyone for your inputs. I will check out the 22V10. Hope it is cheap!
best regards,
 
how did it work out? Did you go the PAL or the uC route?

Also, there are generaized Barker codes. Use complex +/- j and +/-1 as your chips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor