I currently have firmware that can reach an average deep sleep current of ~130uA. I can reach this level reproducibly on one of the boards I have.
successful deep sleep
Trouble is, when I try to clone this chip onto other chips using the nRF Programmer (Connect) app, I get extremely high power consumption, average of ~20mA at all times, seems the device doesn't reach deep sleep properly. Tried this on several other boards, so I don't believe it's simply a problem of something shorting. Strangely, the application just runs fine, the current is just several times normal for the same functionality.
unsuccessful deep sleep
Does anyone have any ideas on how I can truly clone the flash of one device, onto another? Clearly the "save as file" on nRF Connect isn't doing this. Erasing all and reuploading, starting from a blank chip and writing,
FYI I'm using the nRF52840 module by Raytac (MDBT50Q), implemented on a custom board. This board SHOULD be capable of going down to ~33uA, which I have observed in the past with this very board. By some combination of erasing all, reprogramming, setting the 3.3V logic level(nrfjprog --memwr 0x10001304 --val 5), etc,
For posterity, I did actually find the solution! For anyone else in a similar boat to me, the winning command is:
nrfjprog.exe --readcode --readuicr --readram [filename.hex]
Apparently, the --readram was the winning flag, as without it the sketch simply doesn't run at the same current consumption for whatever reason. But now, I can reproducibly image and transfer identical firmware, which was what I was after.
Related
I'm trying to get arduino uno to sequentially extract liquid from each of four chambers to a main chamber using solenoid vales, flowmeter, level sensors, and a centrifugal pump. process being open main tank solenoid valve, open valve one, extract quantity one, close valve two, delay 1 second, open valve two....
Does anyone know the best way to go about programming this? I have no coding experience outside of mathematic analysis. Trying to get it directly in the Arduino IDE. I'm also at the same time checking liquid levels and controlling temperature.
You should do one step at a time. Your project is pretty ambitious as a first project.
I would suggest going first for some small examples like letting a LED blink, using a button etc. to get a feeling for the IDE and C syntax.
When you feel confident enough with basic programs you can progress. I'd suggest to go one sensor/actuator at a time. Trying to communicate with it and verifying the data.
But keep in mind this won't be just a coding project but there will be a substantial mechanical/electrical part. Especially when dealing with liquids there are a ton of different hose diameters, voltage levels, etc.
You have to work out how to power the pump and valves safely, because the Arduino board can't handle greater currents.
If you really want to go into this project, you surely can. But keep in mind that this won't happen in a week. To get this working properly you probably will have to invest months and educate yourself not only on the programming side, but also on the electrical side.
I am working on a project that requires me to use 2 separate Arduinos running independently from each other. Now, both of these Arduino's are running the same code, but I noticed that after 10 minutes or so, one of them falls behind and this time difference keep increasing with time. Like I already mentioned, the Arduino`s are identical and I bought them at the same time and they are running the same copy of the program. Any ideas what might cause this and how can I fix it?
Thank you.
Here is the link to the Arduino that I bought just in case.
My Arduino modules on Amazon
The Crystal Oszillators have tolerances up to 100ppm (extreme case), which means you could possibly get 16Mhz*100ppm = 1600 clock pulses difference per second. Also the differences of the runtime could be caused by small voltage differences. Even if there is a voltage Regulator on the Board it has small tolerances, based on the fact, that it operates in the Range of MHz this can climb up to an recognizable Offset.
A possible solution is a synchronization of both microcontrollers. I'm not an expert, so the following solution is a possible and easy one, but definitly not the best.
If they are near by each other you can use two pins of each controller. One as Input and one as Output. Write something like this in your code (same for both if you use the same Pins):
digitalWrite(outPin, LOW);
while(digitalRead(inPin)){};
digitalWrite(outPin, HIGH);
Connect the Output from the first to the Input from the second and the same from second to first.
This results in a waiting state for each cycle of the faster Controller until the slower one reaches the same Programm Part. But be careful if one of them stucks somewhere it will stop the second one too. So there is no redundancy! if this was your goal, don't use this method and search for other synchronisation methods.
Perhaps you can use some RTC (real time clock) hardware to help you to keep they synchronised. They are really cheap and easy to use.
I've been writing a LabVIEW program to drive 3 axis Newport SMC-100 stepper motor controller for horizontal, vertical and rotational movement. I've implemented a for loop that repeatedly perform .3 degree turn followed by 5 separate horizontal movement until it turns a full circle. The program always fails at tellcontrollerstatus.vi, and gives me VISA 1073807339 timeout error. When I restart the program, it'll tell me there is no RS-232 connection available. The weird thing is, it happens at various loop iteration.
I'm sure the COM port setting is correct. If it's a simple program that tells the rotational stage to make a full turn in 1000 steps, it doesn't have any problem. It's only when I try to control two axes in each loop that I have problem.
I tried implementing delay using flat sequence but it doesn't really help. Eventually, I gave up changing the program and just tried another USB-RS-232 adapter cable. Then the problem is gone.
Although the problem was solved, it's not based on good diagnostic procedure and seems to be sheer luck. I'd like to know if there is a proper way to diagnose this kind of problem?
I always use addrcom to diagnose port.
http://www.ontrak.net/adrcom.htm
Also, you can short circuit pin 2 with 3 on DB9 and see weather do you receive the same data you have sent over COM. If you do so it means that your USB-RS-232 adapter cable working properly.
I'm building a small robot that uses a relay to power the motors. To run the relay, I have it connected to pins 11 and 12. If I use something like the Blink example, where it turns the pin on, then off a second later, it works fine. However, what I'm trying to do is keep a pin on until an IF statement is met. When I run it, it turns the pin on for a millisecond or so, then off permanently. How could I get this to work?
Well, I have a couple guesses, but your description is vague without knowing what the IF statement is...maybe it is being met somehow without your knowledge.
I am pretty certain the light is staying on longer than a millisecond in order for you to see it. As a side note, here is an interesting, related article: http://www.100fps.com/how_many_frames_can_humans_see.htm
Are you debouncing? http://arduino.cc/en/Tutorial/Debounce
I can imagine a simple program with an IF to count button presses -- or the timing of -- where, without debouncing, you will meet the conditional without it seeming correct.
This is just one possibility, but without knowing the code, or the setup it's hard to say.
I have some old relays that controlls an hydraulic motor.
I want to control it with my Arduino. Is this possible?
The relays used are:
DIL 00 52 from klockner moeller.
this is the situation:
I have experience with the arduino but not that much about electrical schemas?
Is there someone that can help me?
Is this equipment functional now?
The part you have pictured looks like it is for an engine lathe, not a pump.
The amount of rust in the box and corrosion on the overloads and relay would make me think that it has run either outdoors, or in a corrosive environment for quite a while with the door open. Why would you run it with the door open?
Because you have to continually reset the overload and or adjust the timer, or tap on the contacts to get them to engage. Either way, this thing is a mess.
The relays you have shown will interface easily with your arduino, but I WOULD NOT replace what's in the cabinet with these.
The set up in this cabinet is for three phase power. The one on top is the main contactor, and the two side by side units are for reversing the motor. Something you don't want to do with a pump.
My advice to you is to find an electrician before going any further with the power end of this project.
it is possible but probably that relay won't fit the load.
You have to be sure to use relay that can sustain at least the same load and spike current (and voltage), or you many bad thing may happen, like melting togheder the relay contact or burn your house down.
i can't see the code on the relay in the second picture, neiter you had given the load information, so i can't help you more.