PIC and AVR - Differences that may be missed?

be80be

Joined Jul 5, 2008
2,395
There all good i do no this a pic can take a beating and keep on working.
but a avr can't do the same without breaking.

The avr is great at a lot of stuff if you need fast counting the timer setup seems to be better.
Guess that's why you see them in things that need good timing speed.

I'm not the best writer but there is a place for both pic would of been arduino if microchip would of opened up
the compiler for free like AVR is.

But now there really no AVR and PIC it's Microchip PICAVR wonder what nice new chips will come out now.
I no there working something good there.
 

alfonsoM

Joined Nov 8, 2017
41
The AVR was nothing before Arduino invented a programming language that normal human can use, a kind of language that pic used all along. Without a good compiler mcu is useless to most engineers.
 

kubeek

Joined Sep 20, 2005
5,796
The AVR was nothing before Arduino invented a programming language that normal human can use, a kind of language that pic used all along. Without a good compiler mcu is useless to most engineers.
What do you think people used before that arduino "language" came (which actually is just a bunch of C++ libraries)? They did not write code on punch cards, they used C like any other normal human would.
And the GCC and G++ compilers for AVR were here long before arduino, otherwise arduino couldn´t come into existence.
 

be80be

Joined Jul 5, 2008
2,395
I've never had a pic burn out a pin.

Avr I got 3 dead chips and one set the config wrong it now thinks it the wrong chip that one probably fix able

I've not run into them in much of anything that's in a hard environment.

Pic and in cars AC uint boards hot tubs
AVR in cameras microwaves washers
 

be80be

Joined Jul 5, 2008
2,395
Arduino is a ide using libraries sad part is most people can't figure that out and it can do a lot more then it does
I played with it without the cores let's you have total control and use plain old c code fro avr.

Save room and better code but you have to write it all
without cores means no libraries just just good old avr-gcc=4.9.2
 

alfonsoM

Joined Nov 8, 2017
41
You mean C++?
No, I meant arduino language, for example: pinMode(ring, INPUT_PULLUP);

What do you think people used before that arduino "language"
This is an example to code I used which isn't arduino nor human.
Code:
  TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);
  while (!(TWCR & (1<<TWINT)));
  //write address
  TWDR = 0b10100001;
  TWCR = (1<<TWINT)|(1<<TWEN);
  while (!(TWCR & (1<<TWINT)));
 
  for (i=0; i<0xfff0; i++)
  {
  //send ACK
  TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWEA);
  while (!(TWCR & (1<<TWINT)));
  OCR0A =  TWDR;
  }
 
Last edited:

be80be

Joined Jul 5, 2008
2,395
I was thinking about that I got a older computer now that has a Parallel port but not found a programmer
I was flashing bootloaders and loaded wrong one.
AVR can be a pain avrdude sometimes don't play fare lol
 

philba

Joined Aug 17, 2017
959
No, I meant arduino language, for example: pinMode(ring, INPUT_PULLUP);


This is an example to code I used which isn't arduino nor human.
Code:
  TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);
  while (!(TWCR & (1<<TWINT)));
  //write address
  TWDR = 0b10100001;
  TWCR = (1<<TWINT)|(1<<TWEN);
  while (!(TWCR & (1<<TWINT)));

  for (i=0; i<0xfff0; i++)
  {
  //send ACK
  TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWEA);
  while (!(TWCR & (1<<TWINT)));
  OCR0A =  TWDR;
  }
As has been said, that's not a language, that is a library. And, you can write that kind of giberish in the arduino IDE. AND, if you try, you can write the same sequence in human understandable code. Plus, a few more detailed comments wouldn't hurt.

What arduino brought to the party was an easy entry - no programmer needed. And a few simple libraries that lowered the skill level needed. But the underpinnings are C++, a bootloader and the AVR.
 

alfonsoM

Joined Nov 8, 2017
41
I was thinking about that I got a older computer now that has a Parallel port but not found a programmer
I was flashing bootloaders and loaded wrong one.
AVR can be a pain avrdude sometimes don't play fare lol
This is the parallel programmer I used to revive the locked ATMega: http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/
It uses arduino Uno, no need for LPT (parallel port). It writes parallel data to the AVR instead of SPI or UART.
 

alfonsoM

Joined Nov 8, 2017
41
As has been said, that's not a language, that is a library. And, you can write that kind of giberish in the arduino IDE. AND, if you try, you can write the same sequence in human understandable code. Plus, a few more detailed comments wouldn't hurt.

What arduino brought to the party was an easy entry - no programmer needed. And a few simple libraries that lowered the skill level needed. But the underpinnings are C++, a bootloader and the AVR.
I guess "real men" write their programs in machine code. Well, whatever pleases you.
 

philba

Joined Aug 17, 2017
959
I guess "real men" write their programs in machine code. Well, whatever pleases you.
You can denigrate me all you want but that doesn't change the truth of what I said. I prefer not to celebrate the dumbing down of microcontrollers. Understanding what's going on under the covers makes for better programmers.
 
Top