Replacing Arduino with AVR microchip in working project

Go To Last Post
34 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

First steps in AVR coding, and would appreciate some guidance.

The only experience I have with AVR, is programming an ATTINY45 to drive IR LEDs at 36kHz.

 

Currently I have a working set-up on a breadboard connected to an Arduino that is running code.

I would like to replace the Arduino with an AVR (wiring in the process: a battery, a cap and three physical pull-up resistors). 

 

1) Which AVR would you recommend, knowing that space and cost is an issue?

 

I need 6 pins, including 2 regular I/O pins, 2 digital pins usable for interrupts and a TX and RX pin for my HC-05 Bluetooth module.

Preferably I would be able to burn code using the Arduino ISP routine.

 

2) Converting code

 

Is it correct to say that all pure C code, used in my Arduino sketch, can remain unchanged, and only the Arduino functions (such as declaring a pin as input or output) need to be translated to AVR code?

How would one normally go about doing that? Google each individual one and check the datasheet, I'm guessing.

 

3) Two specific questions on converting code

 

I'm using attachInterrupt() on Arduino. Any advice on how to convert this to AVR code?

I already found Dean Camera's guide to AVR interrupts on http://www.fourwalledcubicle.com/AVRArticles.php

 

I'm using an HC-05 Bluetooth module.

First I start serial communication on the AT 38400 baud rate to change the name of the module, then on 9600 baud rate to Serial.print() an integer to an app on my phone. 

What would the AVR equivalent of Serial.begin() and Serial.print() be?

On Arduino, I need to use a baud rate of 9600 for HC-05's communication. Do you expect this to be any different on the AVR microchip?

Last Edited: Mon. Jul 29, 2019 - 09:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

NilsDeschrijver wrote:
1) Which AVR would you recommend, knowing that space and cost is an issue?
An Arduino is (usually) an Atmega328P so it's the obvious "stand alone" chip to pick. If you program the Arduino bootloader into it (which again is built for 328P) then you can continue to send code to it using the Arduino IDE.
NilsDeschrijver wrote:

Is it correct to say that all pure C code, used in my Arduino sketch, can remain unchanged, and only the Arduino functions (such as declaring a pin as input or output) need to be translated to AVR code?

How would one normally go about doing that? Google each individual one and check the datasheet, I'm guessing.

There's nothing particularly "special" about Arduino or it's library code - it's all C++ built with avr-g++  so you can continue to use exactly the same in AS7. In fact you can even continue to use pinMode()/digitalWrite()/etc if you want to.

NilsDeschrijver wrote:
I'm using attachInterrupt() on Arduino. Any advice on how to convert this to AVR code?
Again you are making a mistake in thinking that is not "AVR code". It is AVR C++ code written for a mega328P. You can just use it "as is". If you want to rewrite your own implementation for some reason it's just going to involve configuring INT0/IMNT1 yourself and providing your own INT0_vect/INT1_vect

 

I do wonder what merit you see in ditching the Arduino support code anyway? Sure people moan about the inefficiency of digitalWrite() which is naturally inefficient because of the pin numbering indirection it provides but the majority of the Arduino library code is pretty good so you might put a lot of effort into just doing a rewrite of something that actually turns out to be buggy and inferior.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Many many thanks for your reply.

 

My reasoning came from hardware programming, I believe you call it, an ATTINY chip to use its timer to drive a LED (CTC/toggle mode and what not) using registers. I understand from your post that I can choose to not convert the code and go with the Atmega328p chip and you in fact see no immediate added value in changing code.

 

The SMD version of that chip is tiny indeed and less than $2. I'll go with that!

 

The only issue then is that I was planning to take the chip off the PCB to reprogram while further testing the final set-up. I was thinking of using a through-hole package to put the chip in, so I could pry it out.

Would you have any documentation on how to burn the bootloader and code, using an Arduino, to the SMD chip using a breadboard?

 

EDIT: I understand that SMD mounts are for industry professionals with ovens and not for hobbyists with a soldering iron. The through-hole ATMEGA, with its 28 pins, is a bit too big I'm afraid, since I'm very limited in space.

Last Edited: Mon. Jul 29, 2019 - 11:26 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

NilsDeschrijver wrote:
EDIT: I understand that SMD mounts are for industry professionals with ovens and not for hobbyists with a soldering iron.
Not true - while their are some chip packages that require industrial production (ball grid array) most SMD (SOIC, TQFP, etc) can be done by hand if you are careful.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Just buy an Arduino Nano. It is fairly small. Plenty good enough for prototype development.
.
When you want to sell 10000 products, a nice Chinese company will make it for you with the tiniest components.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Although I agree with the advice above, one alternative is the tiny85, it comes in through hole version, or smd, both are easy to hand solder, and you can find Arduino support for it, so code migration is fairly easy.

For T85, use the board Arduino Gemma and see if your sketch will compile, post here if you have any issues.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ki0bk wrote:
one alternative is the tiny85
While I don't disagree per se:

NilsDeschrijver wrote:
I need 6 pins,

The t85 has 5 I/O pins plus the RESET pin, which can of course be disabled to allow a 6th I/O pin, but that is not generally for beginners.

 

A possible alternative is to use picoboot on the t85, but that might also be a steep hill to climb since it requires a forked build of avrdude.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just noticed I need a 7th pin, to connect HC-05 pin 34 to enter AT mode.

That makes 7 + 2 = 9 pins.

 

Thanks for the clarification.

I'll go with the ATMEGA283P SMD.

 

I'll look up some documentation on how to burn the bootloader and code, using an Arduino, to the SMD chip using a breadboard.

 

Last Edited: Mon. Jul 29, 2019 - 02:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that I only suggested 328 as it's very likely the same thing you are using for an Arduino (assuming Uno) anyway. But don't get too bogged down with that - if you want 14 or 20 pins rather than 28 there are other AVRs that deliver that. If you are not up to TQFP soldering then SOIC may be a compromise between that and DIP - but as the pins get easier to solder (larger, more widely spaced) the package sizes get larger so it's a trade-off.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don/t see anywhere where you say how big your code is now.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The only issue then is that I was planning to take the chip off the PCB to reprogram while further testing the final set-up. I was thinking of using a through-hole package to put the chip in, so I could pry it out.

Some thoughts:

 

Projects tend to grow.

It is usually wise, therefore, to start with a larger than needed micro.

You don't want to be almost done with your code, and then run out of memory space.

 

After your project is up and running some more you might well find that the code needs an additional feature, or some extra error checking for special cases, etc., and you will need the extra code space for Version N+1.

 

Don't pry chips...  Their little legs are too fragile for multiple relocations.

It is usually a good idea to put a programming header on the PCB, and then just program the chip in place, in the circuit.

There is a 6-pin "standard" for ISP programming, and if you use it then any MC/Atmel programmer, or clone, can easily connect to the board to program it.

 

As mentioned, you might consider just using an Arduino Nano and designing your PCB and extra hardware around that.

Sounds crazy, but it makes for a solid design, and is very inexpensive and very compact.

It gives you the micro, a power supply, a USB interface chip and a USB connector, a push button reset switch for the micro, and all of the pins broken out for easy access.

Clone versions are < $3 USD.

You can't beat that price wise, and it would be very challenging to beat that in terms of PCB space (for a human assemble-able board), unless you have a lot of experience.

 

You can Program a Nano with the Arduino Bootloader via its USB interface, or using a programmer and the ISP interface.

 

You might wish to post your schematic and see if anyone has any suggestions prior to laying out your board and getting it made.

If you do so please include your power supply, by-pass caps, etc.  i.e. include everything in the schematic.

 

If you have an "extra" I/O pin or two, you might consider bringing them out for an LED or a 2-pin header, (with Ground).

I frequently use an LED for debugging, (For example, it makes it easy to see if an ISR is firing!).

The extra pin also makes it easy to connect an O'scope, (using the LED or just a spare 2-pin header), for checking timing, etc.

 

Stop worrying about soldering SMD parts vs soldering through hole parts.

Just give it a try!

Once you start using (and soldering) SMD you will likely quickly find that that is your preferred approach.

 

There are many Threads here, and you tube videos, of SMD soldering.

This Link  (Post #13), shows using an old kitchen frying pan to solder up some SMD boards.

It is definitely not a well controlled oven following manufacturer reflow temp curves, but for my purposes it works great.

 

The Line Following Robot, shown below, was a "quickie" project, and shows embedding an Arduino Nano as the core of the project.

 

If you wish, as your project progresses, also post your PCB layout.

Definitely not my area of expertise, but once again you can often gain some useful feedback prior to submitting your files to get the boards made.

 

Good luck with your project!

 

JC

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GitHub - nerdralph/picoboot: Automatically exported from code.google.com/p/picoboot due to picoboot beta 2 | AVR Freaks (64 bytes)

 

edit :

Microchip's unified memory AVR bootloader consumes 256B (194B actual, 190 SLOC) with a Python loader (104 SLOC)

AN2634 - Bootloader for tinyAVR 0- and 1-series, and megaAVR 0-series

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Mon. Jul 29, 2019 - 10:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone.

 

I decided to finish my code before posting again.

In my final set-up, I need 8 + 2 = 10 pins, including 4 regular I/O pins, 2 digital pins usable for interrupts and a TX and RX pin for my HC-05 Bluetooth module.

 

When I say I have a small area to work with, I mean 4 cm wide and preferably max. 6 cm high.

I'm making an occupancy detector that is mounted on the side of a door frame.

 

My sketch uses 3918 bytes (12%) of program storage space on Arduino. 

The global variables use 278 bytes (13%) of dynamic memory, leaving 1770 bytes for local variables.

 

Finally, the 'portability' of the code is an important factor.

 

Reading your comments, the best solution seems an AVR SOIC with 14-ish pins.

Seems very doable to solder one of those.

 

Would you be willing to recommend one? 

EDIT: I cannot find an ATMEGA328P SOIC.

Last Edited: Tue. Aug 6, 2019 - 08:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

One of your key requirements there seems to be the UART thing so probably a key part of the choice is to pick a chip with a "real" UART. (if you see the word "USI" run swiftly in the other direction). This will actually limit your choice quite a lot as not many of the Tiny chips do have a "real" UART - but a lot of the recently released "XTiny" chips do.

 

Dial your choices in here:

 

https://www.microchip.com/maps/Microcontroller.aspx

 

When I put some of your requirements into that I get these suggestions:

 

 

also

 

 

 

EDIT: You just edited your post - I thought you were fixed on Tiny - if also considering Mega then you need to try that in the above too but you'd have to remove the <= 14 pin requirement as no Mega fall into that category.

Last Edited: Tue. Aug 6, 2019 - 08:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you.

This is very useful! 

 

I'm thinking Mega because of your very first reply.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It used to be the case (with the original exception of the Tiny2313 - but later some others) that no Tiny had a real UART but in the last couple of years (since Microchip took over Atmel) they have started producing "souped up" Tiny chips that do have real UART. These are "AVR-0/1" family devices which are sometimes called "Xtiny" as they are more like a cut down version of the Xmega range.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Great project, DocJC.

The use of the frying pan was unexpected, but I guess anything is possible when done right.

 

Just wanted to let you know that I will post my PCB layout after designing it.

Thank you for the offer of having a quick look at it! 

Do I post it in this thread?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

NilsDeschrijver wrote:
Just wanted to let you know that I will post my PCB layout after designing it.
Suggest you prototype everything first. Many of the threads we see here are people looking for software workarounds to PCB design errors. If you prototype things first you catch the oversights at that stage before you commit to copper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fully agree, and will do.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

NilsDeschrijver wrote:
EDIT: I cannot find an ATMEGA328P SOIC.
Closest is mega328P in PDIP-28 (35mm long) and mega4809 in PDIP-40 (53mm long) (that's more a follow-on to mega324PA PDIP)

QFP can be soldered as easily as SOIC.

megaX08 in SSOP-28 is reduced pitch from SOIC though it's relatively easy to solder.

 

P.S.

NilsDeschrijver wrote:
... and a TX and RX pin for my HC-05 Bluetooth module.
That's the advantage of Bluetooth 2 and 3 is Serial Port Profile (SPP)

The disadvantage is some operator devices are Bluetooth 4.0 and subsequent (Bluetooth Low Energy, no SPP)

Transparent UART is a feature of some Bluetooth 4 and 5 modules; EZ-SERIALTM at Cypress Semiconductor.

Lots of both Bluetooth at Martyn Currey | Mostly Arduino stuff

 


ATmega328P - 8-bit AVR Microcontrollers

ATMEGA4808 - AVR Microcontrollers - Microcontrollers and Processors

EZ-SERIAL™: EZ-BLE MODULE FIRMWARE PLATFORM (Cypress Semiconductor)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
That's the advantage of Bluetooth 2 and 3 is Serial Port Profile (SPP)

 

The disadvantage is some operator devices are Bluetooth 4.0 and subsequent (Bluetooth Low Energy, no SPP)

Bluetooth 4.0 doesn't imply BLE only.

You can have a BT 4 (or greater) BLE only device.

But you can also have a BT 4 (or greater)  device that supports all the usual features of 'classic' BT and BLE. This is quite common.

You can even have a BT 4 (or greater) device that doesn't support BLE at all (probably not too likely in real world, but allowable).

In short, you unfortunately can't tell that much about which features are supported from the number, since pretty much everything is optional.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone.

In the end, I decided on the ATTINY841-SSU.

 

I soldered it to an adapter and connected it to a breadboard using breakout headers.

This video explains how to get code on the chip using Arduino as ISP but using a Nano.

 

Could anyone please point me to a diagram for the Arduino Uno, which I am using?

 

I cannot find it anywhere.

In the video he mentions that 'the pins are the same' (for Nano and Uno). That can't be right?

 

My next step then is to change the pins in the code to match the 841 pins.

I think I can leave the INPUT_PULLUP, without using a physical resistor, and then need to connect VCC, GND, 8 wires and a cap.

 

Regarding to those 8 wires, I think these should become:

- pin 5 and 6 for RX and TX (Bluetooth HC-05 module);

- pin 11 and 12 for my two attachInterrupt() functions;

- any of the  others, except RESET PB0, PB1 and PB3, for digital I/O.

 

Does that seem right?

I was hoping to learn which pins I could use as digital I/O on page 55 (10.2) of this datasheet, but I can't make much of it.

A nudge woud be appreciated.

Last Edited: Sat. Aug 24, 2019 - 11:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


NilsDeschrijver wrote:

Could anyone please point me to a diagram for the Arduino Uno, which I am using?

 

I cannot find it anywhere.

In the video he mentions that 'the pins are the same' (for Nano and Uno). That can't be right?

https://www.arduino.cc/en/tutori...

 

for your target T841, here are the pins you use.

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much.

That solves the issue of the wiring diagram.

For other people that are interested, this schematic works for the Arduino Uno: http://elecrab.com/wp-content/up...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, after two days of tinkering, it worked.

Thank you ki0bk, because that link really did it for me.

 

I have one final question.

Using this schematic (source), I changed my Arduino Uno's pins to 841's pins:

I read that, when using SpenceKonde (Dr. Azzy) his ATTinyCore, you do not need to set the I/O pins as PWM, since it does it for you.

Knowing that, I changed my Arduino code to pins 2 to 7 and 10 for digital I/O, including 2 PWMs for attachInterrupt().

That corresponds with wiring at physical pins 5 to 13, including 11 and 12 for RX/TX. 

The rest of the code I left unchanged, including INPUT_PULLUP.

 

Does that seem right to you?

I prefer not connecting the rest of my circuit for testing until I'm relatively sure it's not entirely wrong and damages the entire thing.

 

Finally, after some more reading, I came accross this (source):

"The amount of a current which a digital pin is able to source or sink is very limited, in the datasheet (page 246) there is a statement with a limit of 40 mA per pin (in many cases it is good practice to keep it under 10 mA at 5V), and the total current of all the pins cannot exceed 100 mA. If the current were to go up those 40/100 mA the microcontroller would overheat and get damaged irreversibly."

 

I currently work with 5V. 

This is my button with RC filter attached to the 841:

I also have a LM393 dual op-amps of which both outputs are directly connected to the 841.

 

Does it seem like any extra protection, vis-a-vis that max. current, is needed?

 

Many thanks to you all for helping to accomplish my project!  

Last Edited: Sun. Aug 25, 2019 - 10:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I also have a LM393 dual op-amps of which both outputs are directly connected to the 841.

 

What supply is the opamp running off (ex: 12v)...Usually I include 1K or so as part of a noise RC filter. In case the opamp tries to overdrive the AVR input the resistor is quite helpful.  Also, that lets you gnd the ADC pin or inject with your own voltage for test.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Aug 25, 2019 - 05:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The switch circuit is fine, current wise.

Worst case scenarios:

The switch is open, the I/O pin is accidentally made an output and is made low.

I = V/R

I = 5V/49K = 0.1 mA, trivial.

 

If the I/O pin is high, then there is 5 V across both sides of the two resistors, and no current lows.

(Ignoring that the output High isn't quite 5 v...)

 

If the switch is closed, then the 39K resistor is grounded.

Again, if the I/O pin is high, I=V/R, = 5/39K, = 0.12 mA, again trivial.

 

This time if the I/O pin is low no current flows.

 

When the I/O pin is correctly configured as an input, to read the switch's state, the I/O pin has a very high impedance, and essentially no current flows.

(When you are working on long lasting battery powered projects, then the analysis for I/O pin currents needs to be a little bit more precise.)

 

So, your switch is no where near drawing the pin current limit, even in mis-configured, worst case scenarios.

 

JC

 

Edit: Typo

 

Last Edited: Sun. Aug 25, 2019 - 11:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

NilsDeschrijver wrote:
I also have a LM393 dual op-amps of which both outputs are directly connected to the 841.

 

The LM393 is a Dual Differential Comparator with open collector outputs, cannot be used as an opamp replacement.

 

Discussion https://electronics.stackexchange.com/questions/253109/can-a-comparator-lm393-be-used-as-an-amplifier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It runs off 5V. 

 

I read in the datasheet that the max. output current may be as high as 20 mA, independent of the magnitude of VCC.

Which led me to believe I'm safe.

 

I grounded the output pins using software for a steady signal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's a lot of things coming into play when working with AVR chips.

 

I have the 841 directly connected to the VCC pin of an HC-05.

Reason for this, is that I need to turn it ON and OFF together with its PIN34, to enter AT MODE in a certain sequence.

Because of the 40mA restriction, that is probably not the best idea.

 

I was therefore thinking of adding a BS170 Mosfet N-Channel (60V, 0.5A):

  • 841 output pin to GND via a 10K resistor
  • 841 output pin to gate, middle pin, of the Mosfet
  • Mosfet pin 3 Source to GND
  • Mosfet pin 1 Drain to HC-05 GND pin
  • HC-05 VCC pin to VCC

 

Does that sound reasonable?

Does the wiring seem right?

 

I'm finishing up the project.

I'll post a picture when I'm done, if anyone is remotely interested.

Last Edited: Tue. Aug 27, 2019 - 09:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You have the right idea.

 

Implementation can be a little bit tricky.

 

You have to make sure that the NFet that you select can be fully turned on with a logic level drive signal on the Gate.

Some can, some can't.

 

An option, for a high side driver, is to have the uC drive an NFet, which then drives a PFet, that actually turns on and off the device.

An example is shown in Post #7 in this Thread.

 

JC

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Back to the root of the topic! 

I finally got around to testing the 841, after solving another issue.

It doesn't seem to work so I was, once again, hoping for some valuable feedback. 

 

Process:

I soldered the 841 on an adapter and checked all pins using a multimeter for cold joints.

Then I connected the pins using this schematic, posted earlier.

 

I used the online Arduino environment to burn the ArduinoISP sketch to my Arduino.

Then I used the offline Arduino program, using ATTinyCore as such:

 

I burned the bootloader and it did so succesfully.

I then copy-pasted my own sketch in the offline environment and uploaded it, which also worked without a single error.

(For some weird reason I cannot burn the ArduinoISP using the offline program, hence the two-step method.) 

 

Sketch:

I left my sketch unaltered, except for the selected pins which became:

#define BEAM_One 2
#define BEAM_Two 3  

#define LED_Install 4
#define BUTTON_Install 5 

#define AT_Mode 6
#define POWER_On 7

#define LED_Occupied 10

Basically, I thought, 841 physical pins 11 and 12 are TX/RX and 2 to 4 are not to be used, so I can simply select pins 5 to 10 and 13 for I/O.

I then choose the above pins, using the pin mapping in the ATTinyCore documentation, also already posted.

 

ATTinyCore already preconfigures PWM, so it can be used without any extra steps or coding, I read somewhere on this forum.

Physical pins 5 and 6 allow for attachInterrupt(), see PCINT10 and PCINT7.

 

Result:

I connected some LEDs across the board for testing.

They receive signals. One stays HIGH, another HIGH then LOW.

This corresponds to functions in my code, but the pins appear to be scrambled.

(For instance, the LED that should indicate a correct install when a button is pressed [BUTTON_Install] is flashing in accordance with the sequence of HIGH/LOW of HC-05 pin34 [AT_Mode].)

Could also be another reason but I'm stumped.

 

My firstborn child for whoever gets me back on track.

Last Edited: Fri. Aug 30, 2019 - 11:18 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I just figured out that I am trying to use INT on PB2 and PA7, but it only exists on PB1.

I can use PB2 and PA7, but those are PCINT, that change ports and only use CHANGE (not RISING or FALLING).

Consequently, I hope to fix both issues by using this library: https://github.com/NicoHood/PinChangeInterrupt

 

If this is a solution, it is a partial one, since other pins, that simply go HIGH and/or LOW, don't work when tested with LEDs.

They do work, so it is not the soldering, but not as expected.

Last Edited: Fri. Aug 30, 2019 - 12:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Solved. Pin mapping had to be counterclockwise, selected under Tools when burning the sketch with Arduino.