Notifications
Clear all

Uploading protocol

34 Posts
5 Users
4 Likes
1,520 Views
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

My debugging process involves many uploads and I want to be sure that Anuino Nano memory is completely cleaned out during downloading new code.

Should I flush the memory before each upload? If so, how? 

This topic was modified 2 years ago by barrie

   
Quote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2519
 

@barrie

Uploading the new sketch is quite sufficient all by itself.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@will Thank you. That eliminates one suspect.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2519
 

@barrie 

Uh oh ... that sounds ominous. What's happening ?

Anything seems possible when you don't know what you're talking about.


   
DaveE reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1670
 

Hi @barrie,

   I agree with @will's answer with regard to memory holding program code ... merely downloading the revised program code is normally fine, and I would just use it.

---------

The only suggestion I would add ... the term 'memory' in context of microcontrollers can refer to many different types and places, depending upon what you are doing, not just the program memory. Even so, "999 times out of 1000" the download process will reset everything without a problem.

But occasionally, a single 'bit' of memory, which might be a (say) a flipflop in the processor can end up in an unexpected state ... and it may stay in that state until the power is removed.

Hence, if things are playing strangely, then one of the simplest 'debug' things to try, is turn off the power for a couple of seconds, and then try again.

In most cases, it makes no difference, and you still have to find the 'real' problem, but it is a simple trick to eliminate a possibility.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6930
 

@davee And what about stray radiation?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

Well! Dare I say it. Almost time to Celebrate. After a bug ridden day I finally got my small kinetic art display to perform by proximity of the observer. I now have to tweek the manoeuvres. The next phase is to add complementary LED lights. All with a loveable little nano.


   
DaveE reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1670
 

Hi Ron @zander,

  I am not sure what you mean by 'stray radiation'

  If you referring to the effect of ionising radiation/particles, then this is one of the possible reasons why  my power down suggestion is appropriate.

To briefly explain:

   One of the causes of a 'memory' content to be corrupted (e.g. a zero becomes one or vice versa) can be the result of cosmic ray or emission from a radioactive decay. It can also cause a thyristor-style latch up to occur with similar consequences.

In some cases, this can result in the device being permanently damaged, but commonly it just results in a corruption which can be 'fixed' by cycling the power.

Hope this helps. Best wishes, Dave


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2519
 

@barrie 

If you still have room after that you could add some memory and an MP3 player too.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6930
 

@davee Yep, that's it.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@will Crikey, what a great idea. it would be easy to put sound effects on a chip recorder and synchronise it with the movements. How do you check remaining Eprom memory? 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2519
 
Posted by: @barrie

@will Crikey, what a great idea. it would be easy to put sound effects on a chip recorder and synchronise it with the movements. How do you check remaining Eprom memory? 

Since you're just starting out, it may be easier for you to use an SD card to store the music. You can find whatever music, voice or sound effect files and just store them on the card.

There's a project on the Arduino project hub which should help you work your way through the process and help you decide if it's worth the extra trouble 🙂

https://create.arduino.cc/projecthub/ronfrtek/arduino-mp3-player-07ad15

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @barrie

Well! Dare I say it. Almost time to Celebrate. After a bug ridden day I finally got my small kinetic art display to perform by proximity of the observer. I now have to tweek the manoeuvres. The next phase is to add complementary LED lights. All with a loveable little nano.

Do we get to see a video???

My Library Makers Group is doing a pair of animatronic eyes and one member is working with a pair of HC-SR04 sensors working in triangulation so the eyes follow the observer.  Sounds like similar problems had to be conquered.  

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
Topic starter  

@will Thanks for that link. It was very interesting. It got me buzzed with an overflow of ideas.

By the way I have an interesting bug. I multiplied a float by an integer and got a silly answer. 

do all numbers have to be the same type? OR is it something else?


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @barrie

By the way I have an interesting bug. I multiplied a float by an integer and got a silly answer. 

do all numbers have to be the same type? OR is it something else?

No, it should have converted the integer to a float and then do multiplication, unless you have some odd type casting going on.  Show us the full equation and identify what variable types are in it.

BUT... what is the variable type you're placing the answer in?  That might give you some interesting (bizarre) results.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Page 1 / 3