[{"data":1,"prerenderedAt":223},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fboards\u002Farduino-mega-2560":3},{"id":4,"title":5,"body":6,"description":215,"extension":216,"meta":217,"navigation":218,"path":219,"seo":220,"stem":221,"__hash__":222},"content\u002Fdocs\u002Fboards\u002Farduino-mega-2560.md","Arduino Mega 2560",{"type":7,"value":8,"toc":209},"minimark",[9,13,17,22,122,126,145,149,166,170,205],[10,11,5],"h1",{"id":12},"arduino-mega-2560",[14,15,16],"p",{},"The Mega 2560 is the AVR-family big sibling: 54 digital pins, 16 analog inputs, 256 KB flash, 8 KB RAM, and four hardware UARTs. If you've outgrown the Uno's pin count but want to stay on the AVR architecture, this is the board.",[18,19,21],"h2",{"id":20},"specs","Specs",[23,24,25,38],"table",{},[26,27,28],"thead",{},[29,30,31,35],"tr",{},[32,33,34],"th",{},"Property",[32,36,37],{},"Value",[39,40,41,50,58,66,74,82,90,98,106,114],"tbody",{},[29,42,43,47],{},[44,45,46],"td",{},"MCU",[44,48,49],{},"ATmega2560, 16 MHz",[29,51,52,55],{},[44,53,54],{},"Flash",[44,56,57],{},"256 KB (8 KB used by bootloader)",[29,59,60,63],{},[44,61,62],{},"RAM",[44,64,65],{},"8 KB",[29,67,68,71],{},[44,69,70],{},"GPIO",[44,72,73],{},"54 digital (D0–D53)",[29,75,76,79],{},[44,77,78],{},"ADC",[44,80,81],{},"16 analog inputs (A0–A15)",[29,83,84,87],{},[44,85,86],{},"PWM",[44,88,89],{},"15 PWM outputs (D2–D13, D44–D46)",[29,91,92,95],{},[44,93,94],{},"I2C",[44,96,97],{},"1 bus — D20 (SDA), D21 (SCL)",[29,99,100,103],{},[44,101,102],{},"SPI",[44,104,105],{},"1 bus — D50 (CIPO), D51 (COPI), D52 (SCK), D53 (SS)",[29,107,108,111],{},[44,109,110],{},"UART",[44,112,113],{},"4 ports — Serial \u002F Serial1 (D18\u002FD19) \u002F Serial2 (D16\u002FD17) \u002F Serial3 (D14\u002FD15)",[29,115,116,119],{},[44,117,118],{},"OTA",[44,120,121],{},"Not supported (no off-chip flash)",[18,123,125],{"id":124},"flashing","Flashing",[14,127,128,129,134,135,139,140,144],{},"Plug into USB. The on-board ATmega16U2 acts as the USB-serial bridge and the bootloader handles uploads via STK500 protocol — same flow as the ",[130,131,133],"a",{"href":132},"\u002Fdocs\u002Fboards\u002Farduino-uno-r3","Uno R3",". Flash from the ",[130,136,138],{"href":137},"\u002Fplayground","Playground"," or ",[141,142,143],"code",{},"pio run -t upload -e mega2560",".",[18,146,148],{"id":147},"notes","Notes",[150,151,152,160,163],"ul",{},[153,154,155,156,159],"li",{},"8 KB of RAM is more than the Uno but still tight for ambitious projects. Watch your ",[141,157,158],{},"String"," and dynamic allocation.",[153,161,162],{},"Because Serial is the host transport for CONDUYT, use Serial1\u002F2\u002F3 for any other UART devices you wire up.",[153,164,165],{},"D13 has the on-board LED. Useful as a status indicator that doesn't conflict with anything.",[18,167,169],{"id":168},"compile-flag","Compile flag",[171,172,177],"pre",{"className":173,"code":174,"language":175,"meta":176,"style":176},"language-ini shiki shiki-themes github-light github-dark","[env:mega2560]\nplatform = atmelavr\nboard = megaatmega2560\nframework = arduino\n","ini","",[141,178,179,187,193,199],{"__ignoreMap":176},[180,181,184],"span",{"class":182,"line":183},"line",1,[180,185,186],{},"[env:mega2560]\n",[180,188,190],{"class":182,"line":189},2,[180,191,192],{},"platform = atmelavr\n",[180,194,196],{"class":182,"line":195},3,[180,197,198],{},"board = megaatmega2560\n",[180,200,202],{"class":182,"line":201},4,[180,203,204],{},"framework = arduino\n",[206,207,208],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":176,"searchDepth":189,"depth":189,"links":210},[211,212,213,214],{"id":20,"depth":189,"text":21},{"id":124,"depth":189,"text":125},{"id":147,"depth":189,"text":148},{"id":168,"depth":189,"text":169},"Mega 2560 board guide — ATmega2560, 54 digital + 16 analog pins, 4 hardware UARTs.","md",{},true,"\u002Fdocs\u002Fboards\u002Farduino-mega-2560",{"title":5,"description":215},"docs\u002Fboards\u002Farduino-mega-2560","lIOUxqPO1ed6QUBeGkkXOH0n80yrir5NulK5DY3K-hA",1777412314780]