Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Binary to "bar"

Status
Not open for further replies.

hantto

Member
Hello, does anyone know a chip that would take binary input and output the binary value increases in a bar.

Like this: (Input - output)
0 - 0
1 - 1
10 - 11
11 - 111
100 - 1111
101 - 11111
110 - 111111
111 - 1111111
and so on

I would require it to be able to display atleast to 8, but 10 or more is fine.

Thank you for your time.
 
Yes I know :) but the whole idea is that i'm a little short on I/O's and that's why I need such a chip. But I could always take an extra PIC and program it to do that.
 
hantto said:
Yes I know :) but the whole idea is that i'm a little short on I/O's and that's why I need such a chip. But I could always take an extra PIC and program it to do that.

Using an extra PIC would give you a simple one chip solution - and, as you're already using a PIC (which I didn't know), it would only require one I/O pin from the existing PIC.

Again, now knowing you're using a PIC, you could use a simple shift register as a 'port expander' - this would use two I/O pins, one for data, and one for clock.
 
Sounds intresting :)

I'm not yet too advanced in pic programming.

But I would love to hear more about how this port expaning works. :)

I have been looking at the MSSP module, and phew, looks very messy to start playing with. Anyways I have also some I²C temperature sensors on the MSSP module (or I WILL have, I haven't programmed that bit yet). But as I have understood every device has their own idetifying adress, so I could easily just connect the second PIC on the I²C lines and have it working. Getting data to or from the second PIC would just involve sending a different identification bit, so the second PIC would respond and not the other devices on the I²C bus?

Thank you.
 
hantto said:
Sounds intresting :)

I'm not yet too advanced in pic programming.

But I would love to hear more about how this port expaning works. :)

Quite simple, a shift register has two inputs, a data input and a clock input. You put you first data bit on the data pin and toggle the clock pin, then put the second data bit on the pin and toggle the clock pin again - you repeat until all eight bits have been clocked into the shift register. You can get chips that work either way, to clock data IN or data OUT.

I have been looking at the MSSP module, and phew, looks very messy to start playing with. Anyways I have also some I²C temperature sensors on the MSSP module (or I WILL have, I haven't programmed that bit yet). But as I have understood every device has their own idetifying adress, so I could easily just connect the second PIC on the I²C lines and have it working. Getting data to or from the second PIC would just involve sending a different identification bit, so the second PIC would respond and not the other devices on the I²C bus?

Yes you could do, but I2C is far more complicated than RS232, a simple single I/O connecting the two PIC's together is all that's needed for a serial connection - I often use it to connect two PIC's together.

I2C master is quite easy to do in software, but for I2C slave you really need hardware, and the PIC I2C hardware has a reputation of being difficult to use, with application notes renowned for not working.
 
Status
Not open for further replies.

Latest threads

Back
Top