ΣSigmaStudio Ask AI Русский Log in

Internal GPIO binary encoding for external logic control

SigmaDSP & SigmaStudio oleveger Mar 1, 2018 00:00 3 replies Original on forum ↗
Subscribe
oleveger Question
Mar 1, 2018 00:00

Hi everyone!

I have a question regarding toggle counter output control signal to GPIO binary signal encode. So when multiplexer input #0 is selected, then GPIO DIG2 - DIG1 (bit 1 - bit 0) is binary 000; when selected multiplexer input #1 DIG1-DIG2 is binary 001, #3 binary 010 etc. Please help me with this function realization. Thank you!

978e6d4003fb1cad924596c4ae7a8466.jpg
978e6d4003fb1cad924596c4ae7a8466.jpg
978e6d4003fb1cad924596c4ae7a8466.jpg-620x370.jpg
978e6d4003fb1cad924596c4ae7a8466.jpg-620x370.jpg
oleveger Reply
Mar 1, 2018 00:00

Can I use two (or more) LUTs for binary encoding as on the picture below?

eabad84e2481879284e3f0ffc4f4d10a.jpg
eabad84e2481879284e3f0ffc4f4d10a.jpg
eabad84e2481879284e3f0ffc4f4d10a.jpg-620x330.jpg
eabad84e2481879284e3f0ffc4f4d10a.jpg-620x330.jpg
KJBob Reply
Mar 1, 2018 00:00

Absolutely! It should work fine.

Bob

DaveThib Reply
Mar 2, 2018 00:00

Hello oleveger,

Another way to do it is to use some bit-wise logic cells. Now these are available on the Sigma300/350 parts. You did not mention the processor you are using.

This may be a little more code efficient but I did not compare the memory and MIPS usage. It will probably depend on the number of bits you want to decode.

I have attached the project in case you want to look at it further.

Dave T

d40f80a3065016e12768de399ebd35d9.jpg
d40f80a3065016e12768de399ebd35d9.jpg
d40f80a3065016e12768de399ebd35d9.jpg-620x214.jpg
d40f80a3065016e12768de399ebd35d9.jpg-620x214.jpg