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.

5 more pins needed on ATmega328

Status
Not open for further replies.

johnny78

Full Member level 5
Full Member level 5
Joined
Jun 28, 2017
Messages
263
Helped
1
Reputation
2
Reaction score
4
Trophy points
1,298
Activity points
3,398
hello Guys
need you help please

im working on a project which includes
3 digits 7segment display = 10 Pins
5 Push Buttons
5 Leds
1 Analog input to measure AC Voltage
1 analog input for thermistor
1 output for buzzer
3 Relays outpus
2 switches inputs

so i need 28 Pins on the MCU & with using internal oscillator on ATmega328 i got 23 pins
i have a display board & mainboard & the mcu is located on the mainboard

so from the requirements is there any suggestion to multiplex some on the inputs or ouputs to get more pins?
ATmega328p size is suitable for my project & i cant use more than 13 pins ribbon cable between the display & the main boards
so any suggestion please?
i was thinking of 16Pin MCU on the display board & use serial communication between the 2 boards
is there an small avr MCU ?
im coding on arduino so if i used Pic16F628 what protocol i can use to communicate between the 2 MCU's

thanks
Johnny
--- Updated ---

s
hello Guys
need you help please

im working on a project which includes
3 digits 7segment display = 10 Pins
5 Push Buttons
5 Leds
1 Analog input to measure AC Voltage
1 analog input for thermistor
1 output for buzzer
3 Relays outpus
2 switches inputs

so i need 28 Pins on the MCU & with using internal scillator on ATmega328 i got 23 pins
i have a display board & mainboard & the mcu is located on the mainboard

so from the requirements is there any suggestion to multiplex some on the inputs or ouputs to get more pins?
ATmega328p size is suitable for my project & i cant use more than 13 pins ribbon cable between the display & the main boards
so any suggestion please?
i was thinking of 16Pin MCU on the display board & use serial communication between the 2 boards
is there an small avr MCU ?
im coding on arduino so if i used Pic16F628 what protocol i can use to communicate between the 2 MCU's

thanks
Johnny
sorry for the mistaken thread title

i need 5 more pins in my case
--- Updated ---

hello Guys
need you help please

im working on a project which includes
3 digits 7segment display = 10 Pins
5 Push Buttons
5 Leds
1 Analog input to measure AC Voltage
1 analog input for thermistor
1 output for buzzer
3 Relays outpus
2 switches inputs

so i need 28 Pins on the MCU & with using internal oscillator on ATmega328 i got 23 pins
i have a display board & mainboard & the mcu is located on the mainboard

so from the requirements is there any suggestion to multiplex some on the inputs or ouputs to get more pins?
ATmega328p size is suitable for my project & i cant use more than 13 pins ribbon cable between the display & the main boards
so any suggestion please?
i was thinking of 16Pin MCU on the display board & use serial communication between the 2 boards
is there an small avr MCU ?
im coding on arduino so if i used Pic16F628 what protocol i can use to communicate between the 2 MCU's

thanks
Johnny
--- Updated ---

s

sorry for the mistaken thread title

i need 5 more pins in my case
what you think of using 1 Analog input for the 5 push buttons with resisotors for each Button ?
is it useful ?
 
Last edited:

You could put all 5 buttons and switches on one pin and do the following -




You have to do the error analysis of R tolerance and supply to make sure your A/D readings
can be deterministic.

Do the design with Vref = Vdd, then its ratiometric and drops out the Vdd as an error term.
If you use the 1V Vref its +/- ~ 9% error, not good.

Regards, Dana.
 
Last edited:

t
You could put all 5 buttons and switches on one pin and do the following -




You have to do the error analysis of R tolerance and supply to make sure your A/D readings
can be deterministic.

Do the design with Vref = Vdd, then its ratiometric and drops out the Vdd as an error term.
If you use the 1V Vref its +/- ~ 9% error, not good.

Regards, Dana.
thaks Dana
im thinking of using Attiny13 to drive the 5 leds & use software serial to control it
whay you think ?

regards
Johnny
 

Hi,

I guess the display is multiplexed. If so you can (double) use some display pins to multiplex the LEDS and/or the push buttons and/or relays (with a latch). This may save up to 12 pins!.
You may use an I2C or SPI port expander
You may use an I2C or SPI display driver

There will be many other options..

Klaus
 

Use HC595 for 8 output = 5Led + 3Relay
You need 03 pins to control 595: Clk, Data, Strobe.
If need more output just serial more 595.

Brg!
 

Use HC595 for 8 output = 5Led + 3Relay
You need 03 pins to control 595: Clk, Data, Strobe.
If need more output just serial more 595.

Brg!
thank you i will check this
--- Updated ---

Hi,

I guess the display is multiplexed. If so you can (double) use some display pins to multiplex the LEDS and/or the push buttons and/or relays (with a latch). This may save up to 12 pins!.
You may use an I2C or SPI port expander
You may use an I2C or SPI display driver

There will be many other options..

Klaus
im using arduino & a library for the display so is it possible to do this ?
--- Updated ---

Why if you have enough pins......?


Regards, Dana.
i dont have any free pin in my case
 
Last edited:

Check out Maxim and TI One Wire / I2C I/O expanders, only need one/two pins
for interface.




You know you can get an ATMEGA in a bigger package ?




Regards, Dana.
 

Check out Maxim and TI One Wire / I2C I/O expanders, only need one/two pins
for interface.




You know you can get an ATMEGA in a bigger package ?




Regards, Dana.
thanks i will check it

& no i cant use bigger MCU the space is enough for ATmega328 only
 

Hi,

my ATMEGA328 is just 5mm x 5mm.
You say there is no space for a bigger MCU. But is there space for an extra IC, or even resistors, or even the traces?

Klaus
 

Hi,

my ATMEGA328 is just 5mm x 5mm.
You say there is no space for a bigger MCU. But is there space for an extra IC, or even resistors, or even the traces?

Klaus
HI Klaus
Yes there is no space for bigger sized MCU on the main board
My board size is 15x5 cm
Let's say I have connectors on one side so I still have about 3,5cm for IC's
I'm using dip version of MCU so the 5mm width is good in my 3.5cm space for traces

regards
Johnny
 

Hi,

I guess the display is multiplexed. If so you can (double) use some display pins to multiplex the LEDS and/or the push buttons and/or relays (with a latch). This may save up to 12 pins!.
You may use an I2C or SPI port expander
You may use an I2C or SPI display driver

There will be many other options..

Klaus
this can be done with assembly right ?
im using Arduino for coding & a library for the 7seg display
is there a way to multiplex the display pins with some pins ?
 

Hi,

A lot of suggestions are given.
A PCB of 150 x 50 mm is huge.
You easily could place 4 ATMEGA328 as SMD instead of one THM.

Regarding library: I can not say whether you can do it, but generally it is possible.
Maybe you need to modify the lib, maybe not.

And, as always: a sketch is very useful, or pictures, photos, schematic...

Klaus
 

Hi,

A lot of suggestions are given.
A PCB of 150 x 50 mm is huge.
You easily could place 4 ATMEGA328 as SMD instead of one THM.

Regarding library: I can not say whether you can do it, but generally it is possible.
Maybe you need to modify the lib, maybe not.

And, as always: a sketch is very useful, or pictures, photos, schematic...

Klaus
hi Klaus
i will try to draw the circuit & send it here
i have alot of parts to place on that space 3 triacs 2 relays TRansformer buzzerEtc...... & i cant use smd on my projects because i dont have the solution to print this kind of circuits here besides its easier to use the dip parts which its almost available here
even all parts are not available the ds2408 is not available & the hc595 uses 3 data lines to give me 8 outputs
i could use ATmega32 if i have space for it but unfotunately i dont
my decission is to use ATtiny2313 on the display board & send serial data from the Main Board ATmega328
this is for driving leds & use 1 analog input to read switches
in this case i need

10 pins for 3 digits 7segments
1 for analog read of switches
1 for send serial data for driving leds
+5v DC
GND

which 14 lines connector is the max lines i can use between the 2 boards
& the display board is smaller & have 5 leds 5 push buttons 3digits 7seg displays so no space for the main MCU

regards
Johnny
 
Last edited:

hi Guys
i couldnt even get attiny2313 so i have purchased Atmega328 smd version & it needs some time
& i will put the main MCU on the display board where there is alot of lines needed i think now i dont have problems with lines & space

regards
Johnny
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top