AD8 is termperature ADC7 ADC6 only on 32MLF package |
Arduino libraries (setMode,digitalWrite,digitalRead
) refers to pins by their digital BOARD number,
i.e. : PD0
:0; PD1
:1, … ,PB0
:8;PB1
:9, … PB5
:13; … (PB6,PB7 used for XTAL),
PC0
:14 … PC5
:19
pins_arduinoDGG.h,standard/pins_arduino.h,
micro,
mega,
leonardo
port A is not defined!i
28 pin packages do not have ADC6, ADC7.
DB6 and DB7 are XTAL and therefore unavailable. This causes arduino numbering oddities i.e. DB6=6; DC0=7
// symbols and macros from arduino.h HIGH LOW INPUT OUTPUT true false SERIAL DISPLAY LSBFIRST MSBFIRST CHANGE FALLING RISING DEFAULT EXTERNAL INTERNAL INTERNAL1V1 INTERNAL2V56 interrupts() sei() noInterrupts() cli() clockCyclesPerMicrosecond() clockCyclesToMicroseconds(a) microsecondsToClockCycles(a) bitRead(value, bit) bitSet(value, bit) bitClear(value, bit) bitWrite(value, bit, bitvalue) analogInPinToBit(P) digitalPinToPort(P) digitalPinToBitMask(P) digitalPinToTimer(P) portOutputRegister(P) portInputRegister(P) portModeRegister(P) NOT_A_PIN NOT_A_PORT PA PB PC PD PE PF PG PH PJ PK PL NOT_ON_TIMER 0 TIMER0A TIMER0B TIMER1A TIMER1B TIMER2 TIMER2A TIMER2B TIMER3A TIMER3B TIMER3C TIMER4A TIMER4B TIMER4C TIMER4D TIMER5A TIMER5B TIMER5C __DATE__ __TIME__ The date & time this sketch was compiled bit(b) word(...) lowByte(w) highByte(w) constrain(amt,low,high) min(a,b) max(a,b) abs(x) round(x) sq(x) ((x)*(x)) PI HALF_PI TWO_PI DEG_TO_RAD RAD_TO_DEG radians(deg) degrees(rad)Defined in
avr/io.h
RAMEND |
SPCR| 1<<DORD
not SPCR|DORD
This is an ATmel convention.
SD/RTC shield schematic |
Rose colored rows are dedicated, that is they cann not be used for anything else. | |||||||||||||||||||||||||||||||||||||||||||
Real Time Clock related DS1307 includes 56 bytes battery backedup RAM | |||||||||||||||||||||||||||||||||||||||||||
SDA | Serial Data to/from DS1307 | No other lines are needed! See Section 21 for ALL TWI details | |||||||||||||||||||||||||||||||||||||||||
SCL | Serial Clock Line to DS1307 | ||||||||||||||||||||||||||||||||||||||||||
SD Card related (uses SPI (Serial Peripheral Interface)) | |||||||||||||||||||||||||||||||||||||||||||
Arduino | Atmega name | SD | |||||||||||||||||||||||||||||||||||||||||
D10 | CS | PB2 | Chip select for SD | pulled up to 5V | |||||||||||||||||||||||||||||||||||||||
D11 | MOSI MasterOutSlaveIn DATAout |
| D12 | MISO | MasterInSlaveOut DATAin |
| D13 | SCK | SCKIN | | N.B. | SCK same as LED_BUILTIN on Duemilanova
| WP | Write Protect
| | CD | Card Detect
| LEDS
| L1,L2 are unconnected, that is they need to jumpered to a data pin to be used. | pin listed is suggestion based on example sketch D3 := 3 | L1 | Red
| D2 := 2 | L2 | Green
| |
SCK
not 19 since that's the pin number only for the ATmega328 PDIP package!
SPI ATmega section 18†
The SPI module is enabled by setting
On the master, the program clears
SPCR control†
|
Serial I/O; Universial Synchronous and Asynchronous serial Receiver and Transmitter register map
|
http://arduino.cc/en/Guide/Environment
Language Reference,
local version
http://arduino.cc/en/Main/Software Git Guide
For MacOSX use Arduino.app found in arduino-1.0-macosx.zip
After you have everything ready and try to remember what your did:.
xxx
has xxx.pde
source(s) in ASCII text
Points of interest:
Serial.print
, goes to tx port, is asynchronous, flush() waits for completion
Serial.end();
#include <avr/pgmspace.>
PROGMEM prog_uint16_t speeds[] = { 300, 19200, 57600 };
PROGMEM prog_uchar signMessage[] = {"I am a big long string with a null terminator");
strcpy_P
copies a string from flash to a string in RAM
example
hexdump -C
char mess[] = "test";
copies 5 bytes from flash to SRAM
#include <EEPROM.h>
EEPROM.write(i, i);
(takes 3.3ms)
value = EEPROM.read(a);
Serialport port: 1 | 2 | 3 (default 1)
| |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
int Serial.available() |
Arduino has has pins for analog input,
for soures ranging from 0 to 5 volts, ( Aref is connected to VCC) .
These are convert it to a number between 0 (0 volts) and 1023 (5 volts) (10 bits of resolution).
bits | bytes | range | ||||||||||
byte ddd | 8 | 1 | 0 - 255 | |||||||||
int ddd | 16 | 2 | -32768 - 32767 0xFFFF | |||||||||
unsigned int | 16 | 2 | 0 - 65535 | |||||||||
long nnnnn |
From "Arduino notebook v1-1" :float
…32bit -3.4028E+38 to 3.4028E38
soft_reset();
cable | 1 |
Two Row
A "complete" hexdump.ino
Collected documents1 MISO, 3 SCK, 5 rst
2 Vcc, 4 MOSI, 6 GND
BUGS
micros,mills,delay,delayMicroseconds
(wire.cpp)
board choices Buy at:
output of compile/link conver to HEX is at :private/var/folders/f6/6ky0bfw11tg_0s27qw1yjgs00000gq/T/build6374132741676520612.tmp
/usr/local/CrossPack-AVR/bin/avr-objdump -j .sec1 -d -m avr5 sss.cpp.hex
dissasembler
JeremyBlum Arduino Tutorial-9-wireless-communication
simulavr