Go Down

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

secretreeve

hi guys, i need help in selecting an attiny chip as i dont understand certain properties.

i am attempting to use the morse library but due to the requirement of hardware multipler? (see below quoted text) i need to find a chip that can handle the library from the attiny selection.

the mega chips such as the 328 is far too big and over powered for this project.

Quote
You'll want to look closer at ATtiny compatibility. I've never used one but here's a Stack Overflow article that seems helpful.
https://electronics.stackexchange.com/questions/80292/what-cant-the-attiny-do-that-the-arduino-can
It does mention that ATtiny doesn't have a full hardware-multiply implementation for factors other than 2. I notice in this "morse.cpp" that at least one function calls on floating-point multiply in MorseSender::setWPM(). Might be more spots; that's the first one I noticed.
Good luck, Barry
ive attatched the morse library as im actually not 100% sure thats the problem, perhaps someone more advanced will know.

Smajdalf

In general you don't need a HW multiplier. It "only" makes multiplying faster with less code. I doubt you need the speed. Try it, the compiler should use the right SW routines for the multiply - you don't need to do anything about it (just specify what chip you intend to use which you need to do in either case).
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

secretreeve

Except the attiny45 for example can't handle the Morse library apparently due to the multiplier. The compiler does nothing to compensate for anything

Smajdalf

You are doing something wrong. What compiler do you use, what settings a what error do you get?
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

secretreeve

#4
Nov 16, 2019, 05:21 pm Last Edit: Nov 16, 2019, 05:56 pm by secretreeve
I'm not doing anything wrong. I'm using the arduino software. It works fine on the mega328 but isn't compatible with the attiny45. It's not a problem with code, it's not a problem with circuitry. It's a chip compatibility issue.  Which is why I'm asking for recommendations of one that is compatible.

Well it is a code problem in that the library and chip isn't compatible so need a small chip that is.

Smajdalf

Clearly you are doing something wrong. If there is a compatibility issue it is not due to the multiplier but due to another peripherals of the chip - maybe timers? If Arduino thinks it is compiling for Arduino Uno (ATMega328p) it will fail for any other chip. I am using Atmel Studio for programming of standalone chips so I don't know how to configure Arduino IDE but you must start with this.
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

secretreeve

#6
Nov 16, 2019, 06:01 pm Last Edit: Nov 16, 2019, 06:02 pm by secretreeve
Okay I'm frustrated because I am not doing ANYTHING wrong. Everything is fine, it works on the arduino perfectly but not a 45. Despite the code writing successfully to the chip as verified by other code aspects working fine.

The Morse library DOES NOT work on the 45 so back to my original request for someone to look at the library and see what's going on with compatibility or recommend a chip that's small it WILL work with.

Please stop assuming I am doing something wrong as I'm perfectly capable to loading the program successfully and have been through this on other threads relating to it

Smajdalf

If you are not doing ANYTHING work it is great - your project surely works. If it does not work something must be wrong. You do very little to help to find what is wrong. Missing HW multiplier is almost sure not the reason why it does not work. But since you don't say what is wrong I am not going to guess. Are you able to upload other code to ATTiny45? Are you unable to compile this particular code? Or you can compile it but it does not work? What it does and what it should do?
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

secretreeve

If you are not doing ANYTHING work it is great - your project surely works. If it does not work something must be wrong. You do very little to help to find what is wrong. Missing HW multiplier is almost sure not the reason why it does not work. But since you don't say what is wrong I am not going to guess. Are you able to upload other code to ATTiny45? Are you unable to compile this particular code? Or you can compile it but it does not work? What it does and what it should do?
How dare you assume I have done nothing to find out what's going wrong! I've asked for help and all you are doing is being argumentative in not understanding a simple request
 I don't understand the library enough to make changes to it, but I do know it DOES NOT run on a attiny45 chip but DOES on the mega.

If your too closed minded to understand the entire code loads to the chip but the library isn't working on it then go away and let someone else help who understands what's going on. I can't stand arrogant people who just assume the error is with me. How is it I can load up any other sketch to the chip and that work fine but this one doesn't?! I'm doing what's right but your being stubborn and not appreciating that there IS intact a compatibility issue somewhere between the library and chip. So go away

secretreeve

And I already stated the remainder of the code loads to the chip and works but the library for Morse doesn't.

Clear observation you didn't pay attention

PerryBebbington

Hello secretreeve,

May I suggest that you consider for a moment that the people here answering questions and providing help are doing so as volunteers and are doing their best to help others learn about electronics and micro controllers. The answers Smajdalf has given you might not be what you were hoping for but I sure they are his best attempt to help you. Being rude to him is hardly going to encourage him or anyone else to give you the help you need.

Thank you.

secretreeve

Hello secretreeve,

May I suggest that you consider for a moment that the people here answering questions and providing help are doing so as volunteers and are doing their best to help others learn about electronics and micro controllers. The answers Smajdalf has given you might not be what you were hoping for but I sure they are his best attempt to help you. Being rude to him is hardly going to encourage him or anyone else to give you the help you need.

Thank you.
Hello secretreeve,

May I suggest that you consider for a moment that the people here answering questions and providing help are doing so as volunteers and are doing their best to help others learn about electronics and micro controllers. The answers Smajdalf has given you might not be what you were hoping for but I sure they are his best attempt to help you. Being rude to him is hardly going to encourage him or anyone else to give you the help you need.

Thank you.
I wasn't being rude, I was simply trying to reiterate that the problem is in the chip is incompatible and that I don't appreciate him not paying attention to what has already been stated. If the original question had actually been addressed then there wouldn't be an issue. I stated a question and got insulted by being told I was doing something wrong. Don't single me out because i stuck up for myself and asked someone to leave me alone unless they was addressing the original question

Coding Badly

Good luck, Barry
Barry is dispensing bad advice.  Stay away from Barry.


Coding Badly

The compiler does nothing to compensate for anything
Post the error message(s).  Please use code tags.


secretreeve

#14
Nov 16, 2019, 09:35 pm Last Edit: Nov 16, 2019, 09:46 pm by secretreeve
Post the error message(s).  Please use code tags.


There is no error messages. This is the thing, the code compiles and run on the arduino, I.e my code and the Morse code using Morse library.
As soon as it's loaded into the attiny45 my code runs fine but the Morse doesn't function.

I have led flashers and other stuff going on as well as the Morse code, all the leds wrote high and flashers run but no Morse code when loaded up. I've checked the pins and everything with it. The library has to be the problem in relation to the chips abilities. Perhaps the arduino has an extra something that's allowing it to run?

So there is no error messages or anything to post up. Sorry.

I'll load JUST the Morse into a chip when I get home later and see what happens buy will8ng to get it compiles and loads bit doesn't run

Go Up