Author Topic: Does anyone have a copy of MPLAB or XC8 -- AVR includes?  (Read 1594 times)

0 Members and 1 Guest are viewing this topic.

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« on: February 19, 2022, 08:14:22 am »
Specifically whatever they're using for avr-libc, because AVR-DA isn't supported by any version that exists on the internet. ???

(And no, I'm not installing that pig just to grab a few hundred bytes of plain text, that's asinine.)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1492
  • Country: us
  • Very dangerous - may attack at any time
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #1 on: February 19, 2022, 08:44:28 am »
attached
 

Offline cv007

  • Frequent Contributor
  • **
  • Posts: 879
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #2 on: February 19, 2022, 09:02:10 am »
https://packs.download.microchip.com/

These are zip files so just rename it, open it and find what you wanted.
 

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #3 on: February 19, 2022, 11:19:07 am »
Appreciate the effort, but those are io headers, not avr-libc.  You know, inc/ and inc/avr/*.h, other than io*.h's.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 856
  • Country: gb
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #4 on: February 19, 2022, 11:31:46 am »
Have you looked at the github repository of avr-libc?
 

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #5 on: February 19, 2022, 12:01:49 pm »
They don't Github, officially speaking:
http://svn.savannah.gnu.org/viewvc/avr-libc/trunk/avr-libc/
Most of it around 6 years old.

There's an updated fork here:
https://github.com/stevenj/avr-libc3
but again no AVR-DA.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1492
  • Country: us
  • Very dangerous - may attack at any time
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #6 on: February 19, 2022, 12:23:09 pm »
Why would libc headers need to be changed for DA???

More stuff attached.
 
The following users thanked this post: T3sl4co1l

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #7 on: February 19, 2022, 06:56:29 pm »
Compare sleep.h, old (from line 140):

Code: [Select]
/* Define an internal sleep control register and an internal sleep enable bit mask. */
#if defined(SLEEP_CTRL)

    /* XMEGA devices */
    #define _SLEEP_CONTROL_REG  SLEEP_CTRL
    #define _SLEEP_ENABLE_MASK  SLEEP_SEN_bm
...

new:

Code: [Select]
/* Define an internal sleep control register and an internal sleep enable bit mask. */
#if defined(SLEEP_CTRL)

    /* XMEGA devices */
    #define _SLEEP_CONTROL_REG  SLEEP_CTRL
    #define _SLEEP_ENABLE_MASK  SLEEP_SEN_bm
    #define _SLEEP_SMODE_GROUP_MASK  SLEEP_SMODE_gm

#elif defined(SLPCTRL)

    /* New xmega devices */
    #define _SLEEP_CONTROL_REG  SLPCTRL_CTRLA
    #define _SLEEP_ENABLE_MASK  SLPCTRL_SEN_bm
    #define _SLEEP_SMODE_GROUP_MASK  SLPCTRL_SMODE_gm
...

AVR-DA are xmega2 core, but don't have the same registers.  Old headers get the error (on using sleep_enable():

Code: [Select]
main.c|237|error: 'MCUCR' undeclared (first use in this function); did you mean 'MCU'?|
which occurs because the above #if-else falls through to the default (!defined(__DOXYGEN__)) case.

Oh interesting, stdlib.h doesn't define itoa family.  Easy enough to fix.

That does it, thanks!

Edit: Let it be known, I have stumped the internet at large.  Searching for "_SLEEP_SMODE_GROUP_MASK" as a keyword turns up only:
https://www.avrfreaks.net/forum/attiny104-power-down-mode-and-external-interrupt
which, as far as Google knows, is the only example in the entire internet (or, second once this post gets indexed shortly).

Tim
« Last Edit: February 19, 2022, 07:04:43 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline cv007

  • Frequent Contributor
  • **
  • Posts: 879
Re: Does anyone have a copy of MPLAB or XC8 -- AVR includes?
« Reply #8 on: February 19, 2022, 10:28:33 pm »
Some of these things you are better off dealing with yourself. A few lines of code, stick it a header, and you are all set. No need for a library to do all this for you.

Code: [Select]
//Slp.h
#include <avr/io.h>
typedef enum { SLP_IDLE, SLP_STANDBY, SLP_PDOWN } slp_t;
static inline void slp_sleep(slp_t e){
    SLPCTRL.CTRLA = (e<<1)|1;
    sei();
    asm("sleep");
    SLPCTRL.CTRLA = 0;
}

Compare what you then get-
slp_sleep( SLP_PDOWN );

vs what libc will make you do, if you can figure out what all the macros are up to.


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf