this post was submitted on 15 Jun 2023
1 points (100.0% liked)

AVR

59 readers
1 users here now

This is an UNOFFICIAL AVR community.

This is a community for people who use AVR microcontrollers. This can include Arduinos, Arduino clones, Arduino like boards, and stand alone AVR chips and self-designed boards.

NOTE: If your circuit is doing something weird when you touch a wire or move your hand across it see this pinned post.

This is a community for everyone who is interested in AVRs and Arduinos from beginners to experts, kids to adults, hobbyists to engineers.

You may also be interested in:

Arduino

RULES:

  1. All Lemmy.ca rules apply here.

  2. Everyone (see rule 98) is welcome.

  3. If you’ve seen a question 100 times answer it the 101st time or ignore it. Even better, write a complete, detailed answer and suggest that the mod(s) pin it to the community.

[Did you actually think there were 98 rules?]

  1. If you present something as fact and are asked to provide proof or a source provide proof or a source. Proof must be from a reliable source. If you fail to provide proof or a source your post or comment may be removed.

  2. Don’t be a dick. Yes, this is a catch-all rule.

  3. The mod(s) have the final say.

founded 1 year ago
MODERATORS
 

If your circuit is behaving weirdly, switching on when you touch a wire or move your hand over the circuit you almost certainly have a floating input. You can solve this problem with a pull-up resistor. Many AVRs have built-in pull-up resistors that you can turn on using code.

In Sketch:

pinMode(2, INPUT_PULLUP);

In BascomAVR:

Config Portb.1 = Input Set Portb.1

There's a great article at SparkFun about Pull-up Resistors.

top 2 comments
sorted by: hot top controversial new old
[–] Arghblarg@lemmy.ca 0 points 1 year ago (1 children)

I'd also add: always have a cap between your AVR's VCC and GND. Unless your power supply is incredibly clean, it's good to have.

[–] MapleEngineer@lemmy.ca 1 points 1 year ago

Very, very good point. I always put a 0.1uF cap between Vss and Vdd on my chips as close to the chip as I can get it.

As I understand it many chip manufacturers specify what cap or caps you're supposed to use for decoupling. I saw a video where the guy said that the manufacturer of the chip that he was talking about suggested a small ceramic like I use plus an electrolytic. I've never done that. I should probably look at the datasheets more often.

Thanks for the comment!