Hello! I am currently working on a project that involves the Arduino Mega 2560 and the Adafruit micro SD card datalogger, a MPU6050, and an Adafruit MPL3115 temp/press/altitude sensor. Eventually I will add 4-6 servos as well. This is the payload a high powered rocket will launch. I am interested in making a custom PCB for this project as well. Currently my sketch uses 87% of the current memory in the Mega's program storage space, so it needs to have possibly more space because of the things I will add. I want it to be about the same speed as well if possible, I2C interface, MISO/MOSI interface (I do not know what it is called) and I need to put it on myself, so preferably a PIC microcontroller. Thank you in advance!
(deleted)
Oh I didn't know there was one, where is that please?
Go google for one - that's what we'd be doing!
This is an Arduino forum. The PIC line is not compatible with the Arduino IDE, so you're not going to find PIC-people here. If you switch to PIC, you'll likely have to rewrite significant parts of your code - you might want to consider sticking with something similar to the mega2560 you've been developing for so far - say, an atmega2561 (since I imagine you won't be using all the pins, so you;d rather the smaller package to make the board smaller and lighter) - I think someone had a 2561 core here (the 2561 is a 2560 with fewer pins, in a smaller slightly cheaper package.
Frankly, in this here microcontrollers section, almost all the knowledgable people posting are AVR-geeks (for example, the people who post asking for help with Arduino 101 in this section get nothing but crickets), and a few people who work with SAM and Teensy devices. The ESP8266 people use their own forum elsewhere (we get tons of people asking for help with them, but not much in terms of people helping them), as do the STM32duino people - even though both of those can be programmed with Arduino - and anything else, I assume they have their own forums, since they never come up here.
As an aside, how the heck have you managed to fill ~200k of flash with a datalogger?! I'm just staring at that number in disbelief...
First of all I would like to say I am so sorry, I am sort of new to this whole thing I just got the Mega 2560 because it was faster and had more storage space, so now I am looking at all the other options for microcontrollers. And after a certain amount of research I concluded that microcontrollers such as the Arduino Uno chip were called PIC microcontrollers and other chip shapes such as the Mega 2560 were, not. I now realize that is from another manufacturer and whole different thing all together. I need a chip that is the shape of the Arduino Uno chip or "packaging"?
For your other question, I managed to fill it somehow with all the external libraries that my sketch accesses. It uses SD libraries, the libraries that the temp/pressure sensor uses for its math, and the libraries for the gyro/accelerometer that you use to access the DMP (?) On the chip and use its math. The global variable dynamic memory is rather high as well but I can get around that if need be.
Basically I need a chip that is either the same as performance-wise or better than the Atmega 2560 that has the same shape/packaging? as the Uno's chip. Thanks
Also, if there is not one, let me know. I may be able to get it to work with multiple microcontrollers but I would rather not. I want the different shape (like the Uno) because I want to mage the PCB myself and otherwise it would be... heck, to solder I have been told
Aaah!
PIC is an architecture - the instruction set, and how the memory is organized internally, etc. This has no bearing on the package they're available in.
The classic Arduino boards use the AVR architecture; these have incredible code portability across the product line. The USART on the attiny2313, with 2k of flash is the same as the ones the atmega2560 (used in the mega) has - plenty of code in my attiny core is copypaste from the official core. (Other architectures are often similar to this regard; PIC is significantly worse (though their on-chip peripherals are often really sexy), STM32 line is pretty good
Unfortunately, the AVR line doesn't have their biggest (in terms of flash) chips available in the DIP package like the Uno uses. The biggest AVR in DIP is the atmega1284p with 128k of flash (and a whopping 16k of ram!) in a DIP-40 package.
If you're making a custom board to send up in a rocket, where weight and space are at a premium, though, that bulky DIP-40 package seems unappealing - the SMD packages are smaller and lighter (plus you can get the top of the AVR line - the 2560 and 2561 in them). I'd use TQFP package ones if you're hand-soldering it (you look at those pins and say "I can't solder that"? - yes you can! Google "drag soldering" - it's magical. I would rather solder TQFP than DIP by hand now that I've gotten the hang of drag soldering.), or, if youv'e got a reflow oven, one of the smaller no-lead packages as they're lighter.
I would recommend trying to find whatever godawful library is eating all your flash and find an alternative; that's just grotesque for what it sounds like you're trying to do. I would also be tempted to use an EEPROM instead of an SD card - SD cards are fiddly and failure prone and the library is bloated because of the more complicated protocol you need to use to access them.
Finally - the whole AVR product line is almost the same speed. You get more pins, more on chip peripherals with the high end ones, but they all run at 20mhz or below (normally 16 for 5v applications, 8 for 3.3v ones). The small ones lack hardware implementations of some mathematical operations.
Christ, I need to stop writing essays for you for free and do the work I came here for (which will actually make me money).
Thanks for the essay.
Thank you for explaining all of this to me I won't ask for any more essays and I will spend a lot of time researching what all of you have given me. Anyway go make some money!
If you need a small '2560 system board, I offer one:
http://www.crossroadsfencing.com/BobuinoRev17/
I plug on a Programmer to bootload it, and an FTDI Basic for serial downloading/debugging.
Attach a 5V supply and connectors of your choice to mate to other devices for a standalone system.
Or the design can be expanded to add other chips and keep the whole thing small, or maybe layer up chips on other boards to make a small, stacked up system.
Do not fear surface mount soldering. If you have a proper soldering iron that can take differently shaped tips, ready my praise of the knife tip in Reply #246 of the linked thread. Even without an exotic tip like that, a decent small chisel tip is good enough to solder nearly everything (except stuff with pads in the center obviously, like BGA). With flux, solder wick, thin diameter solder, and a good tip, most common SMD parts are easy.