Can someone tell me how to enable the internal pull up resistors in ATmega328p chips?
I'm trying to avoid C at the moment... any way to do that graphically?
Cheers!
Enabling internal pull-ups on AVR's
Moderator: Benj
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: Enabling internal pull-ups on AVR's
Write down the following C code.
(All B port pull up)
And input flowchart pull-up into the port bits.
Code: Select all
PORTB = (1<<PB7)|(1<<PB6)|(1<<PB5)|(1<<PB4)|(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0);
And input flowchart pull-up into the port bits.
Re: Enabling internal pull-ups on AVR's
Thx for your fast reply STibor.
I wrote down the code and I've inserted it at the beginning of the flowchart, after the "BEGIN" flowchart icon.
I just don't understand what you mean by "input flowchart pull-up into the port bits."
Do you mean to simply use inputs as normal by defining a single bit from port B?
Cheers!
I wrote down the code and I've inserted it at the beginning of the flowchart, after the "BEGIN" flowchart icon.
I just don't understand what you mean by "input flowchart pull-up into the port bits."
Do you mean to simply use inputs as normal by defining a single bit from port B?
Cheers!
-
- Flowcode v5 User
- Posts: 211
- Joined: Tue Feb 19, 2013 9:51 pm
- Has thanked: 72 times
- Been thanked: 177 times
- Contact:
Re: Enabling internal pull-ups on AVR's
If you need to program the registers in a micro, which is required to do what you need, without using the 'Insert C Code' icon you could try this method. Define a Flowcode variable in Supplementary Code... to be the register you need to use and then add that variable to the Project explorer. You can then perform calculations on that register just like you would any other variable.
More information is here: http://www.matrixtsl.com/mmforums/viewt ... 26&t=14096
I wrote a simple example for that chip using this method however, I have never used an ATMEGA micro so I can't test it or even check to see if it compiles. Hopefully it will work.
More information is here: http://www.matrixtsl.com/mmforums/viewt ... 26&t=14096
I wrote a simple example for that chip using this method however, I have never used an ATMEGA micro so I can't test it or even check to see if it compiles. Hopefully it will work.
- Attachments
-
- pullup_resistors.fcfx
- (4.36 KiB) Downloaded 493 times
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: Enabling internal pull-ups on AVR's
This is how I did it.
- Attachments
-
- inter_pull_up_3.fcfx
- (4.92 KiB) Downloaded 565 times