Skip to content

Commit

Permalink
Extra newlines, spelling errors, 2.1.x documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenceKonde committed Oct 13, 2020
1 parent 7c515d3 commit e7b8356
Show file tree
Hide file tree
Showing 34 changed files with 15 additions and 56 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ In versions prior to 2.0.0, this was instead configured using the Tools -> SPI P
This core disables the SS pin when running in SPI master mode. This means that the "SS" pin can be used for whatever purpose you want - unlike classic AVRs, where this could not be disabled. Earlier versions of this document incorrectly stated that this behavior was enabled in megaTinyCore; it never was, and SS was always disabled. It should be re-enabled and the SS pin configured appropriately (probably as INPUT_PULLUP) if master/slave functionality is required.

### I2C (TWI) support
All of these parts have a single hardware I2C (TWI) peripheral. It works exactly like the one on official Arduino boards using the Wire.h library, except for the additional features noted below. See the pinout charts for the location of these pins. You must be sure to use external pullup resistors on the SDA and SCL lines if the devices you are connecting do not have thos integrated (many Arduino/hobby targeted breakout boards do - typically 10k). The 30k-50k internal pullup resistors were never suitable for I2C pullup resistors - they were, in my opinion, the worst of both worlds; they often did work with the simple test case, leading the developer on their merry way thinking they were all set, only to discover that when they added another I2C device or two, or moved the device to the end of a longer cable, I2C suddenly no longer worked - it's probably better for it to fail immediately, prompting investigation and subsequent addition of appropriate pullup resistors. Note that there is nothing *preventing* one from enabling the internal pullups manually - you just should do so knowing that even if it happens to work, it's not a robust solution.
All of these parts have a single hardware I2C (TWI) peripheral. It works exactly like the one on official Arduino boards using the Wire.h library, except for the additional features noted below. See the pinout charts for the location of these pins. You must be sure to use external pullup resistors on the SDA and SCL lines if the devices you are connecting do not have those on board (many Arduino/hobby targeted breakout boards do - typically 10k). The 30k-50k internal pullup resistors were never suitable for I2C pullup resistors - they were, in my opinion, the worst of both worlds; they often did work with the simple test case, leading the developer on their merry way thinking they were all set, only to discover that when they added another I2C device or two, or moved the device to the end of a longer cable, I2C suddenly no longer worked - it's probably better for it to fail immediately, prompting investigation and subsequent addition of appropriate pullup resistors. Note that there is nothing *preventing* one from enabling the internal pullups manually - you just should do so knowing that even if it happens to work, it's not a robust solution.

On all parts with more than 8 pins, the TWI pins can be swapped to an alternate location.

Expand Down Expand Up @@ -274,10 +274,16 @@ Like ATTinyCore, Sketch -> Export compiled binary will generate an assembly list

### EESAVE configuration option
The EESAVE fuse can be controlled via the Tools -> Save EEPROM menu. If this is set to "EEPROM retained", when the board is erased during programming, the EEPROM will not be erased. If this is set to "EEPROM not retained", uploading a new sketch will clear out the EEPROM memory. You must do Burn Bootloader to apply this setting.
**WARNING** In megaTinyCore 1.0.6 and earlier, this setting is backwards - setting it to retained will not retain, and vice versa. This is corrected in 1.0.7 and later.
**WARNING** In megaTinyCore 1.0.6 and earlier, this setting is backwards - setting it to retained will not retain, and vice versa. This is corrected in 1.0.7 and later. Prior to 2.1.0, there were problems with the EEPROM library as well which could mimic that behavior.

### SerialEvent support option
The Arduino API provides a rarely used method for receiving data from a serial port called [serialEvent](https://www.arduino.cc/reference/en/language/functions/communication/serial/serialevent/). This is truly the simplest implementation of something like that imaginable: Between each iteration of loop(), it will check Serial.available(), and run serialEvent() if it is (otherwise, it's a weakly defined empty function). The problem with serialEvent is that it's no different from just checking Serial.available() in loop() - and that check happens every pass through loop. Even if not using the serial port at all, even if you did your own test of Serial.available(), etc. At best, it's the same, and in all other cases it's worse. As of 2.1.0, SerialEvent is disabled by default, but can be enabled with the

### Startup Time option
As of 2.1.0, there's now an option to set the time between reset (from any cause) and the start of code execution (previously it was always 8ms) - options are 1ms, 8ms (default), and 64ms. The default option is generally fine; occasionally (for example, with particularly slow rising power supplies and no BOD), the slower time may be needed.

### BOD configuration options
These parts officially support BOD trigger levels of 1.8V, 2.6V, and 4.2V, with Disabled, Active, and Sampled operation options for when the chip is in Active and Sleep modes - Disabled uses no extra power, Active uses the most, and Sampled is in the middle. See the datasheet for details on power consumption and the meaning of these options. You must do Burn Bootloader to apply this setting.
These parts officially support BOD trigger levels of 1.8V, 2.6V, and 4.2V, with Disabled, Active, and Sampled operation options for when the chip is in Active and Sleep modes - Disabled uses no extra power, Active uses the most, and Sampled is in the middle. As of 2.1.0, the active/sleep modes have been combined into a single menu, the nonsensical options removed, and the previously unexposed options added: sampled mode is now available with two sample rates (the faster one uses ever so slightly more power, as you would expect), and "Enabled hold wake" - in that mode, BOD is disabled in sleep, enabled when not sleeing, and when waking up, code execution does not begin until the BOD is ready. See the datasheet for details on power consumption and the meaning of these options. You must do Burn Bootloader to apply this setting.
#### Unofficial BOD levels
Between the initial header file and preliminary datasheet release, and the most recent versions of each, several BOD settings (which were described as "unqualified" in the release notes- which I believe means they were not tested or guaranteed to behave correctly) were removed from the datasheet and io.h files. These are still supported by the dropdown menu, but (as of 2.0.4 - the first version that has the new headers) are marked as such in the submenu. Note that the new headers no longer provide the `*_gc` enum entries for these BOD levels. *When using these, proper operation should not be counted on without doing your own testing*

Expand Down Expand Up @@ -330,7 +336,7 @@ Version information for MEGATINYCORE is also provided by a few additional define
* MEGATINYCORE_PATCH 2
* MEGATINYCORE_RELEASED 1
* MEGATINYCORE_NUM 0x02000201
Be warned that the historical record has been
Be warned that the historical record has been rather spotty w/regards to my remembering to update these with each release, making it rather less useful...

### Identifying Timers
Each timer has a number associated with it, as shown below. This may be used by preprocessor macros (`#if` et. al.) or `if()` statenebts to check what `MILLIS_TIMER` is, or to identify which timer (if any) is associated with a pin using the `digitalPinToTimer(pin)` macro.
Expand Down
1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/UART.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,3 @@ class UartClass : public HardwareSerial
extern UartClass Serial3;
#define HAVE_HWSERIAL3
#endif

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ void __cxa_deleted_virtual(void) {
//std::terminate();
abort();
}

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ class Client : public Stream {
protected:
uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
};

2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/api/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int atexit(void (*func)()) __attribute__((weak));
int main() __attribute__((weak));

#ifdef EXTENDED_PIN_MODE
// Platforms who wnat to declare more than 256 pins need to define EXTENDED_PIN_MODE globally
// Platforms who want to declare more than 256 pins need to define EXTENDED_PIN_MODE globally
typedef uint32_t pin_size_t;
#else
typedef uint8_t pin_size_t;
Expand Down
1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/HardwareI2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ class HardwareI2C : public Stream
virtual void onReceive(void(*)(int)) = 0;
virtual void onRequest(void(*)(void)) = 0;
};

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ class IPAddress : public Printable {
};

extern const IPAddress INADDR_NONE;

2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/api/PluggableUSB.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <stddef.h>

// core need to define
void* epBuffer(unsigned int n); // -> returns a poointer to the Nth element of the EP buffer structure
void* epBuffer(unsigned int n); // -> returns a pointer to the Nth element of the EP buffer structure

class PluggableUSBModule {
public:
Expand Down
1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/Print.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ class Print
int16_t printf(const char *format, ...);
int16_t printf(const __FlashStringHelper *format, ...);
};

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/Printable.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ class Printable
public:
virtual size_t printTo(Print& p) const = 0;
};

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ class Server : public Print {
public:
virtual void begin() = 0;
};

2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/api/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <inttypes.h>
#include "Print.h"

// compatability macros for testing
// compatibility macros for testing
/*
#define getInt() parseInt()
#define getInt(ignore) parseInt(ignore)
Expand Down
4 changes: 2 additions & 2 deletions megaavr/cores/megatinycore/api/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class String

// returns true on success, false on failure (in which case, the string
// is left unchanged). if the argument is null or invalid, the
// concatenation is considered unsucessful.
// concatenation is considered unsuccessful.
unsigned char concat(const String &str);
unsigned char concat(const char *cstr);
unsigned char concat(char c);
Expand Down Expand Up @@ -158,7 +158,7 @@ class String
unsigned char startsWith(const String &prefix, unsigned int offset) const;
unsigned char endsWith(const String &suffix) const;

// character acccess
// character access
char charAt(unsigned int index) const;
void setCharAt(unsigned int index, char c);
char operator [] (unsigned int index) const;
Expand Down
1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/Udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,3 @@ class UDP : public Stream {
protected:
uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
};

Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
sprintf(sout, fmt, val);
return sout;
}

2 changes: 0 additions & 2 deletions megaavr/cores/megatinycore/api/deprecated/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../Client.h"


2 changes: 0 additions & 2 deletions megaavr/cores/megatinycore/api/deprecated/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../IPAddress.h"


1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/deprecated/Print.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../Print.h"

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/deprecated/Printable.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../Printable.h"

2 changes: 0 additions & 2 deletions megaavr/cores/megatinycore/api/deprecated/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../Server.h"


2 changes: 0 additions & 2 deletions megaavr/cores/megatinycore/api/deprecated/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../Stream.h"


2 changes: 0 additions & 2 deletions megaavr/cores/megatinycore/api/deprecated/Udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../Udp.h"


1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/deprecated/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
// This include is added for compatibility, it will be remove on the next
// major release of the API
#include "../String.h"

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/api/itoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ extern char* ultoa(unsigned long value, char *string, int radix);
#ifdef __cplusplus
} // extern "C"
#endif

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ int main(void)

return 0;
}

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ void operator delete(void * ptr) {
void operator delete[](void * ptr) {
free(ptr);
}

1 change: 0 additions & 1 deletion megaavr/cores/megatinycore/new.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ void operator delete(void * ptr);
void operator delete[](void * ptr);

#endif

9 changes: 0 additions & 9 deletions megaavr/libraries/SD/examples/Datalogger/Datalogger.ino
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,3 @@ void loop() {
Serial.println("error opening datalog.txt");
}
}









1 change: 0 additions & 1 deletion megaavr/libraries/SD/examples/DumpFile/DumpFile.ino
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ void setup() {

void loop() {
}

3 changes: 0 additions & 3 deletions megaavr/libraries/SD/examples/Files/Files.ino
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,3 @@ void setup() {
void loop() {
// nothing happens after setup finishes.
}



2 changes: 0 additions & 2 deletions megaavr/libraries/SD/examples/ReadWrite/ReadWrite.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,3 @@ void setup() {
void loop() {
// nothing happens after setup
}


3 changes: 0 additions & 3 deletions megaavr/libraries/SD/examples/listfiles/listfiles.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,3 @@ void printDirectory(File dir, int numTabs) {
entry.close();
}
}



1 change: 0 additions & 1 deletion megaavr/libraries/SD/src/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,3 @@ File::operator bool() {
}
return false;
}

1 change: 0 additions & 1 deletion megaavr/libraries/SD/src/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ License: GNU General Public License V3
(C) Copyright 2010 SparkFun Electronics

Now better than ever with optimization, multiple file support, directory handling, etc - ladyada!

0 comments on commit e7b8356

Please sign in to comment.