📜 ⬆️ ⬇️

Why many do not like Arduino

Have you ever wondered why specialists / professionals in the field of microcontrollers and automation treat those who work with Arduino as if they were doing something unimportant, like playing in a sandbox?


Approximately the same way Arduino and my cat Vasya .

Actually for this, I made a video where clearly, using an oscilloscope, I will show and tell, from my point of view, why this is so. I will try to highlight the obvious pros and cons of the Arduino theme:
')


To begin with, it should be said that the Arduino is not so bad as it may seem. It was thanks to Arduino that a lot of various projects were born that would never come true, because of the very large amount of information that needs to be “digested” in order to implement them. It is not a secret for anyone that it is much easier to make some devices on the Arduino, and also more quickly. It is because of this that I began to get involved in the topic of microcontrollers. And gradually I began to outgrow all sorts of digitalWrite (13, HIGH); and switch to PORTB = 32; as the desire to increase the performance of my devices increased.

This is what the code for an ordinary “flasher” looks like in the usual language of the “Arduinschik”:
Open spoiler
// geektimes

void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}



image

, « », Arduino.

:

// geektimes

#include <avr/io.h>
#include <util/delay.h>

int main( void )
{
  DDRB |= (1 << 5);     //  PB5  
  while (1) { //  ,  loop() 
    PORTB &= ~(1 << 5); //     PB5
    _delay_ms(1000); //  1000  
    PORTB |= (1 << 5);  //     PB5
    _delay_ms(1000);
  }
  return 0;
}



image

, , 1030 176 Flash, 6 . , . , , , , .

, , , , , — , , , .

image

Arduino IDE.
, , :

image

— , Arduino IDE . - , ReadAnalogVoltage , , , . , . ? .

, , «» .

\hardware\arduino\avr\cores\arduino Arduino, wiring_digital.c, «» digitalWrite, :

void digitalWrite(uint8_t pin, uint8_t val)
void digitalWrite(uint8_t pin, uint8_t val)
{
	uint8_t timer = digitalPinToTimer(pin);
	uint8_t bit = digitalPinToBitMask(pin);
	uint8_t port = digitalPinToPort(pin);
	volatile uint8_t *out;

	if (port == NOT_A_PIN) return;

	// If the pin that support PWM output, we need to turn it off
	// before doing a digital write.
	if (timer != NOT_ON_TIMER) turnOffPWM(timer);

	out = portOutputRegister(port);

	uint8_t oldSREG = SREG;
	cli();

	if (val == LOW) {
		*out &= ~bit;
	} else {
		*out |= bit;
	}

	SREG = oldSREG;
}



, ( PORTB = 32;). , , , « ». , , Hi-Z( , ) . , .

, .

image

Arduino Pro Mini , . «» :

image

, :

image

(2) — , , (1) :

image

2.67 0.094 , , , :

image

— 28 . , 28 , , , , .

, , , , , .

image

, , , . , .

«», Arduino , Pro Mini , «» , , , Arduino , Arduino Pro Mini Arduino Nano.

, Arduino IDE, , , , ZIP , , , , Atmel Studio. , — ( Ctrl+T):

image

« », , ?

Arduino IDE :

image

, , .

Arduino IDE, , «» .

P.S. , , , « — ».

:

— ;

Arduino IDE ;

Arduino ;

Arduino?;

geektimes.

Source: https://habr.com/ru/post/254163/


All Articles