Replies: 1 comment
-
is true for all modern AVRs and all xMegas (the modern AVRs are more xmega-like than they feel. They realized nobody wants an 8 bit mcu with a 1500 page long programming manual in addition to the datasheet, and so they excised the byzantine peripherals that made everyone pause when looking at xmega and replaced them with simpler more modern peripherals that kept most of the capability but lost the mindboggling complexity.
The new parts themselves get defines of the form
The new part numbers are decoded as: Modern tinyAVRs have numbers that decode as ssfp where ss is 1-2 digits indicating the size, f is 0, 1 or 2 indicating the family and hence featureset - 0 being the ones that chopped out a huge number of features to make a budget part that costs a whole 0-5 cents less than the 1-series, the 1-series being where they tested stuff for the DA/DB (triple analog comparator with window mode, TCD, etc), and the 2-series being the first appearance of the snazzy new ADC (testing it for the EA - they seem to use the tinies as testbeds for new features, or they were doing that for a while at least) and p is a code representing the pincount - 2, 4, 6, or 7 for 8, 14, 20 or 24 pincount parts. Beware that both of the last two conditions must be true on a modern tinyAVR - the tinyAVR 828 has the flash size as the first digit, a 2 as the second digit - but the last digit is an 8 so it's not a modern tiny - it's a classic AVR, likewise the 1634 has has the flash size at the start, and ends with a valid pincount code, but the tens place is a 3, and there isn't a tinyAVR 3-series A nice consistent and systematic change from the to old part numbering system, if you can call that mess a system.... |
Beta Was this translation helpful? Give feedback.
-
Is there a way using an #IFDEF that my code can query GCC as to which processor I'm using? Specifically, I'm writing an Arduino library, and I'd like to pass a PORT address into the constructor. BUT the port address structure is different between the good old atmega processors (such as atmega328, atmega2560, etc) and the DXCORE and MEGACOREX processors. You know, DIR, PORT and PIN vs PORTx.IN, PORTx.DIR, PORTx.OUT and also VPORTx.PIN, VPORTx.OUT, etc.....
SO when I pass in the port address Device(volatile uint8_t * port) do I use it as port.DIR or (port-1)* ?
I've looked in the source files for DXCORE and MEGACOREX but didn't find any #define AVR xxxxx
I suppose I could just create a LONG macro combining the processor name macros for all of the suitable targets such as
#IF_DEFINED (AVR_atmega4809 || AVR_atmega4809 || .... ad nausum ) but there must be a better way?
Beta Was this translation helpful? Give feedback.
All reactions