Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Code for PRBS / PN generation (preferable for AVR)

Status
Not open for further replies.

Eugen_E

Full Member level 6
Joined
Nov 29, 2004
Messages
383
Helped
44
Reputation
86
Reaction score
11
Trophy points
1,298
Location
Romania
Activity points
2,862
generation of prbs

Hello,

I need a code or algorithm to generate PRBS on uC.
I know about using LFSR with feedback for maximal length, but that method seems to be less appropriate for an 8 bit microcontroller - involves lots of bit shifting and testing, it's hard to scale for sequences longer than 2^8 - 1 and this slows the output rate.
I would like something to use byte-oriented instructions rather than bit-oriented.

Thanks
 

prbs lfsr avr code

Using high level programming languages, e, g, C, you would use a long variable for shift register and a constant long XOR mask to generate feedback. That way you'll find the code in literature. Although operation isn't optimized to the limited, the function can be used conveniently without thinking about single bitshifts.

The C shift operation sr <<= 1 is coded by the uP simply as multiple 8-bit RLC operation (rotate left trough carry), which can be easily chained to any wanted bit length, additionally using a storage in memory for shift register, of course. Programming details depend on the respective uP's programming model. When coding in assembler, feedback bits could be evaluated for needed bits explicitely.

Regards,
Frank
 

prbs code

Any idea where I can get PRBS generator and analyzer code in verilog?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top