Trinket Program Awareness

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
AnneBarela
Learn User Page
 
Posts: 757
Joined: Sat Mar 24, 2012 8:56 pm

Trinket Program Awareness

Post by AnneBarela »

Are there constants/variables to allow a Trinket/Gemma to know what its operating voltage and frequency is?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket Program Awareness

Post by adafruit_support_mike »

WRT frequency, the file bootloaderconfig.h contains this:

Code: Select all

#define USB_CFG_CLOCK_KHZ       (F_CPU/1000)
/* Clock rate of the AVR in MHz. Legal values are 12000, 16000 or 16500.
 * The 16.5 MHz version of the code requires no crystal, it tolerates +/- 1%
 * deviation from the nominal frequency. All other rates require a precision
 * of 2000 ppm and thus a crystal!
 * Default if not specified: 12 MHz
 */
and it looks like the value "LOW_VOLTAGE" is defined to indicate 3.3v operation (or, technically, any voltage too low to support a 16MHz clock).

User avatar
AnneBarela
Learn User Page
 
Posts: 757
Joined: Sat Mar 24, 2012 8:56 pm

Re: Trinket Program Awareness

Post by AnneBarela »

Perhaps move to the Trinket forum?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket Program Awareness

Post by adafruit_support_bill »

(Moved)

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”