Go Down

Topic: attiny selection hardware multiplier (Read 699 times) previous topic - next topic

secretreeve

well god knows whats going on, the more advanced version of the same code actually functions perfectly fine on an attiny85 (needed the 85 for flash size)

so i dont understand whats going on as the basic version is the same code with other led commands pulled out.

oh well, i'll work it out later.

thanks for the assistance.

westfw

Maybe you ran out of RAM at runtime.  The t85 has more RAM than a t45. (and both have significantly less than a m328)


secretreeve

#17
Nov 17, 2019, 12:35 am Last Edit: Nov 17, 2019, 12:37 am by secretreeve
Maybe you ran out of RAM at runtime.  The t85 has more RAM than a t45. (and both have significantly less than a m328)


is there anyway within the arduino software to check how much a sketch requires? it would be good to examine this and have a look and would advance my own knowledge significantly in the future.

i suppose a cheap and nasty way would be to load the simpler sketch to the 85 and see if it runs but it would be good if there was an option within avr or something.

CrossRoads

Anytime you compile, the IDE reports how much is used.

Example from a '328P (Uno):
Sketch uses 5604 bytes (17%) of program storage space. Maximum is 32256 bytes.
Global variables use 575 bytes (28%) of dynamic memory, leaving 1473 bytes for local variables. Maximum is 2048 bytes.


The first line is flash memory, which the is the 32K of storage available less the bootload code (hence the maxiimum is less than 32 * 1024, or 32768).
The second line is static RAM, where the variables and the registers that are changed as the program runs are stored.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

secretreeve

it was within limits then. otherwise it kicks up an error was sitting about 86% oh well i got a work around for the simpler one using want states and flasher with digital write. and the more complex variant works so i guess it can be considered a win as theres no change in form factor or size and none in cost really either.

westfw

Quote
it was within limits then. otherwise it kicks up an error was sitting about 86%
The memory usage reported by the IDE is only the "static" (compile-time) memory used.  More memory gets used at run-time, and 86% reported usage on a part with only 256 bytes of RAM is probably way too much.
What's that leave ?  35 bytes for all the run-time consumption?  Ouch.


secretreeve

thats a fair point, i wasnt aware it was static ram usage. lesson learnt? use the 85 isntead of 45 as its just easier to work with larger overheads haha

Go Up