Atmega 328p memory
-
So, in trying to create my in-wall OLED scene controller board I ran into an issue that I thought I might run into. Memory. So I did my test sketch for the OLED display that had some sample graphics with some button controls for testing the keypad. As soon as I tried including the MySensors library into the equation and compiling, I naturally ran out of memory. My assumption is that is the program and variable space limitations of the Atmega 328P that are the main reason I cannot use this level of hardware. So, on to my thought. Is it possible to use an Atmega 644p or 1284p based controller for this? If so, are there any in the size range of a pro mini? If there are none in the size range of a pro mini, I may take a shot at creating a new board of my own. Would an nRF51822 be a better route to go with this? In the mean time, I may find a lighter text based library for the display and try that route with my existing pro-mini.
-
in my opinion atmega is partly on it's way out, more powerful mcu's are available, and some are even cheaper than the aging atmega line of products.
If you are using nrf24, then I would look towards nrf51/nrf52, as it will mean more compact nodes.
-
Im using now mainly NRF51 and SAMD21 MCU, both of them have lot of advantages FLASH, interrupt on all pins, consumption.....
-
@dbemowsk in case you missed it, there was a similar discussion earlier this week https://forum.mysensors.org/post/83419
-
So I have not done anything yet with the nRF51 or 52's. Can I just drop nRF51/52 nodes in to my nRF24 gateway setup and have them work? I am currently using MySensors 2.0. Have not yet upgraded to 2.1 or 2.2. 2.2 from the things I have seen seems a bit buggy right now, but I could upgrade my gateway to 2.1.
As can be seen in the image above, the outer header connections are what I would like to be able to mimic to be backwards compatible with my old board setups. If I was going to move to an nRF51 or 52 board, that is something that I would like to keep the same. I have not looked too much at these yet, but it is my understanding that the nRF51/52 boards contain the MCU and radio in one package. Can anyone that has used these recommend a good reasonably priced module that would work with my setup? I will look at designing a new board around these if things look good..
-
@dbemowsk I like this device because it has headers so no soldering strictly required. Note that the distance is smaller than the "standard" 2.4mm.
-
@mfalkvidd said in Atmega 328p memory:
@dbemowsk I like this device because it has headers so no soldering strictly required. Note that the distance is smaller than the "standard" 2.4mm.
The 2mm pitch is a pain if you do not use the BLE400 motherboard that goes with it.
It took me ages to source a 2mm pitch protoboard then sockets to plug it into.
But it is easy to use.
-
@rmtucker Even if I do design a new board, I would at least like to do a protoboard version first like I usually do, so you have a good point. Will the MySensors library work with a 52832 board like this one? I haven't read up on the differences between the nRF51 and the nRF52 series boards yet. I am going to do more research this weekend.
-
@dbemowsk Very few people use MySensors on nrf5, so there are probably some problems that are yet to be discovered - as with any new technology. With that said, 51822, 51422, 52832 have been confirmed working at some point.
@scalz has had success with the 52840, but it seems there is not full support for all IO ports
@NeverDie has experimented with the 52810
-
@dbemowsk you can also consider the NRF52 DK it's more expensive (32$ at Arrow) but you have jlink included on it to program and debug the onboard nrf52 but also any external nrf51 and nrf52 chip (and also NFC antenna and interface, and 4 extra nrf52 chips if you like SMD soldering). It also has a few LEDs and buttons to quickly make some tests, as well as nice things like jumpers to let you measure current consumption when you want to optimize a battery powered sensor.
Nrf51 is a cortex M0 with 16K or 32K RAM and 256K flash.
Nrf52 is a cortex M4F with 64K RAM and 512K flash. Way more powerful and with more advanced features.
-
@dbemowsk If you're in the USA (which I seem to recall that you are), I recommend the Fanstel modules, because they have passed FCC: http://www.fanstel.com/bluenor-summaries/ Also, most of them share the same pinout, which makes them easy to upgrade.
-
Here's a breakout board that would get you started with most of the Fanstel's:
https://www.openhardware.io/view/489/BT832X-Power-Amplified-nRF52832-Remote-Control-with-LNA
-
If you just want to quickly get a feel for the nRF52, though, I'd recommend getting two nRF52 DK's (one for each end of a radio link). It's probably the least frustrating way to get started, and as @nca78 mentioned, you can use them more generally later as programmers if you take a liking to nRF5's.
-
@neverdie Will the nRF52s work on my nRF24 network?
-
@dbemowsk yes
-
@mfalkvidd Perfect. As I mentioned, I am going to look over the modules this weekend and see if I can find one that is suited for my board.. From there I will look at fabricating a new PCB.
-
@dbemowsk said in Atmega 328p memory:
@neverdie Will the nRF52s work on my nRF24 network?
You mean is it backward compatible? Yes, if you use the mysensors code base. You can thank @d00616 for that. Otherwise it wouldn't be.
-
So looking at a dev board like this one to test things, one thing that I do not see is any analog inputs. I am also wondering about an I2C connection. I am also assuming that the black connector is the programming header.
-
@dbemowsk Most of the GPIO pins can be assigned to be whatever you want. For instance, only one pin can serve as RESET (pin 21), but it can be re-assigned to work as an analog pin if you prefer to use it that way. Likewise, pins can be re-assigned to serve as I2C if you prefer that. All this gives you more freedom in the trace layouts. i.e. it's a good thing.
-
@neverdie So they are not strictly data lines... That is nice. So what you are saying is that if I wire them to the headers on my board, I can just wire the header pins to the closest GPIO lines and then just reference them to what they are in the sketch. Can any of them be SPI bus lines also?
-
@dbemowsk There may be some caveats in the datasheet, but basically yes.
Good luck!
-
I figured I could do my testing with one of the dev boards, and if everything works I can just design a board using one of the surface mount modules. Thanks for all the feedback.
-
For instance, I would suggest not using the NFC pins if you can avoid it. They can be redefined, but they aren't 100% equivalent to the other pins.
-
@neverdie With the number of pins, I am sure I can avoid some without a problem.
-
@dbemowsk That's the spirit! You'll know soon enough if you step on something you shouldn't.
-
WIth a 32 bit processor, 64kB of ram and 512kB of flash, it should have more than enough speed and space for what I want to do. Heck, I could probably fit some onboard sensors like temp and humidity and possibly power monitoring if I can figure out something with my power supply board.
-
@dbemowsk In practical terms, it's even better than that, because the compiled code is more dense.
-
@neverdie So with all of this, would I need to upgrade my gateway to 2.1 or 2.2? I am currently on 2.0.
-
@dbemowsk Forget those. You need to run the most current developers release. It's the safest choice. Perhaps there's a more precise answer, but....
-
@neverdie I always hate upgrading the gateway because it ends up being, do the upgrade and HOPE everything that I have on my network plays well with it. I usually just pull the old pro mini and save it. Then flash a new one with the updated version. That way if I have to fall back I can.
-
Or just set up a parallel network to test on until you're comfortable with it. That's what I do. That way you don't drop the ball with whatever currently works. Hardware is cheaper than your time, and you can recycle it endlessly.
-
@neverdie Great idea. I would just need another FTDI adapter and set up another MySensors instance on my Vera. If I have to order the nRF52, I can order an extra FTDI at the same time. Then I can take my time porting over things to the new gateway and phase out the old one as time and resources permit.
-
This is why I LOVE this forum....
-
Since you're the "new guy," be sure to document your progress as best you can. That will help other "new guys" follow in your footsteps. The more new guys the better. That's what I did with the Bluetooth Actiion! thread, even though, ironically, it ended up having nothing to do with bluetooth per se. But who knew? Where you end up isn't always the direction you were heading originally.
-
@neverdie Well, I am not necessarily new to MySensors, but new to this end of it. I can document and post.....
You know I haven't checked out the bluetooth thread, well, because I thought it was about bluetooth. Looks like I have some reading to do.
-
It's worth a read.
-
@neverdie Skimming the bluetooth thread is interesting. 1377 posts is a lot to look over though.
-
@dbemowsk said in Atmega 328p memory:
@neverdie Great idea. I would just need another FTDI adapter and set up another MySensors instance on my Vera. If I have to order the nRF52, I can order an extra FTDI at the same time. Then I can take my time porting over things to the new gateway and phase out the old one as time and resources permit.
I wouldn't buy the "dev board" you link above in this thread, it's basically a breakout board with a voltage divider, 2 buttons and 2 leds, you'll still need a programmer to use it and it doesn't seem to have any documentation or schematic so you would lose more time figuring out how to connect it than to (for example) solder a 5$ module from aliexpress on one of @NeverDie 's boards.