Microcontroller alternative to Arduino - Page 1
Forum section: electronics / general

author: marty
author_rank: Contributor
timestamp: June 12, 2016, 07:39:38 am
content: I will probably post the problem I have with Arduino coding later, but right now little peeved with the Arduino brand (would say Atmel fanboys but since Micro bought them kind of a little pointless), so what alternatives would you suggest?

author: f1rmb
author_rank: Regular Contributor
timestamp: June 12, 2016, 07:47:28 am
content: Quote from: marty on June 12, 2016, 07:39:38 amHi,STM32 ;-)Cheers.---Daniel

author: Fred27
author_rank: Unknown
timestamp: June 12, 2016, 07:47:36 am
content: Anything. Anything is better than an Arduino.It's there anything particular you want out of it? Low power? Limited to thorough hole? 32 bit just for the hell of it?

author: hamster_nz
author_rank: Super Contributor
timestamp: June 12, 2016, 07:56:04 am
content: Without knowing what you are peeved with, how can we suggest anything better?

author: Ian.M
author_rank: Super Contributor
timestamp: June 12, 2016, 08:02:12 am
content: That's about as useful a question as "I want a vehicle, what do you recommend?"You may need the microcontroller equivalent of a 50cc moped, or of an Aussie 680HP triple trailer road train. Post your problems with Arduino, and explain what you need the MCU to do and you'll get better suggestions.

author: richardman
author_rank: Frequent Contributor
timestamp: June 12, 2016, 08:48:38 am
content: It depends on whether you are p*ssed off with the hardware or the software or both :-)If p*ssed at hardware, then there are plenty "Arduino compatible" Cortex-M and other MCU based boards that use the Arduino software environment. Of course not all shields or libraries are 100% compatible.If software, then you can just use any boards, and program in C/C++ :-) Lots of choices there.

author: CM800
author_rank: Frequent Contributor
timestamp: June 12, 2016, 10:48:34 am
content: I still use the AVRs standalone myself, programmed with Atmel Studio. I just work with the datasheet and registers directly, Often I don't need anything of serious power and honestly it's kinda convenient to use the arduino baseboards as a breakout.I've poked around STM32 and they look like quite a nice option, however I think the software really has something to be desired. I would suggest having a look at the Texas Instruments ARM chips and the NXP Kinetis series, they seem to be quite popular in industry, though it really depends what you are doing.Nothing beats a bit of this:Code:#include <avr/io.h>#include <avr/interrupt.h>#include <stdbool.h>#include <util/delay.h>#define F_CPU 16000000ULint main (void) {//ADC SET UPADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);ADMUX |= (1 << REFS0);ADMUX |= (1 << ADLAR);ADCSRA |= (1 << ADEN);ADCSRA |= (1 << ADSC);ADCSRA |= (1 << ADATE);//PWM SET UPDDRB |= _BV(PB1) | _BV(PB2);TCCR1A = _BV(COM1A1) | _BV(COM1B0) | _BV(COM1B1) | _BV(WGM10);TCCR1B = _BV(CS20);for(;;){OCR1A = ADCH*0.47;OCR1B = 0xff - ADCH*0.47;}}

author: sporadic
author_rank: Regular Contributor
timestamp: June 12, 2016, 12:43:05 pm
content: By "arduino coding", I assume you mean the arduino abstraction? Just use the vendor's native programmer and tools, Atmel Studio in the case of an AVR.Sent from my XT1094 using Tapatalk

author: autobot
author_rank: Regular Contributor
timestamp: June 12, 2016, 12:56:50 pm
content: maybe you would like the mbed.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 12, 2016, 02:44:21 pm
content: Mbed offers similar hardware boards and software abstraction. Is also has a somewhat usefull online ide.But because mbed runs on more complicated and diverse hardware, reading the actual reference manual is unavoidable.https://developer.mbed.org

author: rstofer
author_rank: Super Contributor
timestamp: June 12, 2016, 04:48:17 pm
content: I really like the 'stamp' format of the mbed. I also like their online compiler but I can still pull the code down and compile it with something else. All of the code including the libraries.One of my projects required a high speed SPI slave, interrupt driven. I just wrote my own code and ignored the library code. When it came time to deal with the NVIC, I wrote my own 3 lines of code. There was no requirement to use anything from the libraries. But when I needed TCP/IP, I just used what was available in the libraries. Recreating that code would be too much effort.I don't do a lot of JTAG debugging but it's pretty easy to pull the entire code package into Rowley Crossworks and do the compilation and debugging locally.I have only used the LPC 1768 incantation of the mbed.

author: marty
author_rank: Contributor
timestamp: June 12, 2016, 09:35:00 pm
content: Didn't want to go into much detail until I chilled out..It's more of a I don't understand how the math works out and what I needed to do, so I posted on the Arduino forum and got things like links to Wikipedia and some other rather random less then helpful posts.For some reason I can't get my head around what I need to do to fix the math problem, I believe what I need to do is shift bits but I probably don't have the code right either.I need to get volts and percentages for Duty Cycle..5*Step/65535 = voltagestep/65535*100 = Duty cycleSeems simple enough..But I think what is happening is I go beyond the 16bits and it Zero's thus I get 0 on the lcd display.When I really want to get say for duty cycle 0.001% to 100% and 7.62951E-05 to 5 volts for Voltage

author: dannyf
author_rank: Super Contributor
timestamp: June 12, 2016, 09:44:51 pm
content: QuoteSeems to be unfair to blame that on arduino, or any chip: you will have those issues no matter what chip you use.

author: marty
author_rank: Contributor
timestamp: June 12, 2016, 10:07:17 pm
content: Quote from: dannyf on June 12, 2016, 09:44:51 pmArduino isn't a chip mfg it's a brand that uses the Atmel chip <sigh>

author: Ian.M
author_rank: Super Contributor
timestamp: June 12, 2016, 10:31:55 pm
content: Divide *anything* by 65535 in C using normal (16 bit) unsigned integer maths and the result will be 0 or 1, and it can only be 1 if the input value was exactly 65535. If you need a meaningful result, the expression would need to be carefully written to use long integer (32 bit) maths, and the expression would probably need to be rearranged so that intermediate values didn't overflow or underflow.Dividing by 65535 is also very slow - it it vastly preferable to divide by 65536 which the compiler will implement by discarding the two low bytes (assuming you are using >16 bit maths). You might say why not simply use floats or doubles? Well, what was slow before (32 bit integer division by a non-power-of-two), becomes painfully slow, and the accuracy tends to be even worse for the same variable size as some of the bits that were being used for the actual number are now used for the exponent.Fixed point integer maths is vastly preferable for small embedded systems, but you do have to plan each operation of each calculation to avoid overflows or loosing too much accuracy due to bits dropped at the LSB end, shifting the intermediate value up or down as required. Often the implementation looks nothing like the theoretical calculation . . . .The distinction between Arduino and Atmel ATmega328P isn't particularly useful for this problem as the Arduino toolchain uses GCC, which you are likely to be using anyway for AVRs (unless you've dropped lots of $$$$ on the Keil compiler) and the behaviour of integer maths in C is set by the ANSI C89 standard and its successor ANSI/ISO standards for C and C++., which have generally retained backward compatible behaviour with the C89 standard.

author: marty
author_rank: Contributor
timestamp: June 12, 2016, 10:48:41 pm
content: Quote from: Ian.M on June 12, 2016, 10:31:55 pmSo looks like fixed point math is where I need to focus my learning on then. oops yep 65536 forgot 0 is first step. doh

author: Ian.M
author_rank: Super Contributor
timestamp: June 12, 2016, 11:31:12 pm
content: I should mention that a C compiler is not *required* to use 16 bit integer maths, but an ANSI compliant compiler will have an integer size >=16 bits. A default integer type longer than 16 bits is likely on 32 or 64 bit processors with architectures and instruction sets that penalise 16 bit operations and/or misaligned access to read/store 16 bit values. If you are porting fixed point algorithms, to a processor with a different word size using C's usual integer types, you always need to know the sizes of the types used on both platforms. Its generally advisable to explicitly use theC99 fixed width integer typesso porting your fixed point algorithm doesn't break it.

author: JoeO
author_rank: Frequent Contributor
timestamp: June 13, 2016, 09:16:47 am
content: Arduino is not YOUR problem.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: June 13, 2016, 09:31:56 pm
content: Quote from: marty on June 12, 2016, 09:35:00 pmWhat exactly are you trying to do?

author: marty
author_rank: Contributor
timestamp: June 13, 2016, 09:40:45 pm
content: Quote from: Bruce Abbott on June 13, 2016, 09:31:56 pmJust trying to get Duty Cycle %, I'm a lot closer now at least I'm not getting 0 for results. Just like to get 2 decimal places now and it'll be golden.dcperc = ((pwmstep *100) >> 16);Learned >> 16 << 16 both can be used to divide and multiply by 65536

author: Ian.M
author_rank: Super Contributor
timestamp: June 13, 2016, 10:05:18 pm
content: If pwmstep isn't a long, you'll have problems. Try:Code:dcperc = ((pwmstep *100UL) >> 16);which forces the calculation to use long maths (32 bit on most platforms)

author: marty
author_rank: Contributor
timestamp: June 13, 2016, 10:31:44 pm
content: FFS finally I got it... Here's the damn problemWhen both types are of type int, it does integer divison, which gets truncated to the nearest int value. In this case, dividing one int by another that is larger will result in a value of zero. The conversion to type double only occurs when you assign the computed value to the variable percentage.dcperc = (pwmstep /65536.0) *100;

author: Ian.M
author_rank: Super Contributor
timestamp: June 13, 2016, 11:24:21 pm
content: Yep, but now you are doing floating point maths which is *S*L*O*W* and takes a lot of code space. That *MAY* be acceptable, but if you are trying to update this value often or are short of code space you'll probably need to use fixed point maths.I gather the aim is to get the 16 bit PWM duty cycle as a percentage 00.00% to 99.99%If so a fixed point approach would be:Code:dcperc100 = ((pwmstep *10000UL) >> 16);will get a number in the range 0000 to 9999, a hundred times bigger than the desired percentage, then convert it to a string using itoa() and insert the '.' as you print it, or break it up with /100 and %100 into integer and fractional parts and print them with '.' in between.

author: marty
author_rank: Contributor
timestamp: June 13, 2016, 11:54:00 pm
content: Quote from: Ian.M on June 13, 2016, 11:24:21 pmIt's working for now but I will continue to improve it as I go I've spent 3 days on this now and I have to move on. I believe I tried that too Ian and it (me) failed which is why I was having so many problems.

author: ebclr
author_rank: Super Contributor
timestamp: June 14, 2016, 12:04:18 am
content: Cypress Psoc and STM32 and if want something really real time Xmos

author: marty
author_rank: Contributor
timestamp: June 14, 2016, 12:39:46 am
content: I see a lot talking of microcontrollers but no mention of alternatives to Arduino. So I suppose it comes down to C, C++, and C#, I do recall seeing some drag and drop programming. My understanding is C is best since it's closer to machine language.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: June 14, 2016, 12:47:04 am
content: Quote from: marty on June 13, 2016, 09:40:45 pmStill not fully explained. Where is this 16 bit PWM coming from, and in what way is it related to 0~5V?

author: sporadic
author_rank: Regular Contributor
timestamp: June 14, 2016, 12:56:34 am
content: Quote from: marty on June 14, 2016, 12:39:46 amArduino is about as dumbed down as it gets. Not sure what you're looking for as your problem wasn't arduino the related. Maybe moving to native AVR development and a debug capable programmer like an Atmel ICE would give you a better understanding of what's going on at a lower level.

author: ebclr
author_rank: Super Contributor
timestamp: June 14, 2016, 12:58:47 am
content: Pwm = Pulse Width Modulation , The output will be always s 0 or 5 V ( theoretically) But the key is how long , Duty cycle is how much % they will on on state and off state, foe example 10% duty cicle is turned on 10 % of the oscilanting time and 90% will be off

author: ebclr
author_rank: Super Contributor
timestamp: June 14, 2016, 01:02:04 am
content: "I see a lot talking of microcontrollers but no mention of alternatives to Arduino. So I suppose it comes down to C, C++, and C#, I do recall seeing some drag and drop programming. My understanding is C is best since it's closer to machine language."Not necessarilyCheck this linkshttps://www.hackster.io/rayburne/4-dollar-90-mips-32-bit-72-mhz-arm-arduino-f6e5c9http://www.pinguino.cc/

author: marty
author_rank: Contributor
timestamp: June 14, 2016, 03:03:07 am
content: Quote from: Bruce Abbott on June 14, 2016, 12:47:04 amI have figured out my problem and posted my solution which is that I was dividing an integer into another that was larger thus giving a 0. i just made it float ---> 65536.0 problem solved for now.Yes I can clean it up and make it more lean but I will do that later when I learn more, I just got this Arduino a month ago, and spend maybe 2 weeks working on the coding if you want to call it that.thanks for the reponses.I have everything I need at the moment but thanks for your responses.

author: marty
author_rank: Contributor
timestamp: June 14, 2016, 03:06:27 am
content: Quote from: ebclr on June 14, 2016, 01:02:04 amLOL pinguino, the pic alternative to atmega.thanks

author: sleemanj
author_rank: Super Contributor
timestamp: June 14, 2016, 06:14:09 am
content: Quote from: marty on June 14, 2016, 12:39:46 amUnless I misunderstand your statement there, you seem to be thinking of "Arduino" as a language. It's not. You are writing in C/C++, the IDE does some gruntwork for you in doing the compilation, and there are some libraries and functions provided to you through that, but it's all C/C++ at the end of the day.

author: ebclr
author_rank: Super Contributor
timestamp: June 14, 2016, 08:27:55 am
content: Arduino is a set of libraries but is C running on the root of the things

author: obiwanjacobi
author_rank: Super Contributor
timestamp: June 14, 2016, 09:54:45 am
content: ...Or he means the Arduino IDE..?In that case look at Visual Micro (for Visual Studio) or Atmel Studio (7)... (Windows only)

author: retrolefty
author_rank: Super Contributor
timestamp: June 14, 2016, 11:01:40 am
content: Quote from: ebclr on June 14, 2016, 08:27:55 amRoot? There is no root.All code running an arduino 'sketch' is compiled C/C++.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: June 14, 2016, 12:10:28 pm
content: Quote from: retrolefty on June 14, 2016, 11:01:40 amAnd that's the problem. If only the Arduino used a true high level language such as BASIC, then newbies wouldn't have to worry about the size of an integer or how to show a percentage, because all calculations would be floating point already. And they wouldn't struggle with a syntax that was designed to save typing but makes it too easy to create hard-to-see bugs.

author: dannyf
author_rank: Super Contributor
timestamp: June 14, 2016, 01:09:07 pm
content: "And that's the problem"And the enduring appeall of c. It is a powerful language because of those options it provides.Precisely because of that lack of constraints, it puts a great burden on the programmer to know she or he is doing. This very threads serves as an example of suug consequences when the programmer has no idea about what she or her is doing.Your approach, a potentially valid one for beginners, is highly restrictive andd costly. It amounts to a permanently mounted training wheel on a race bike.

author: asgard20032
author_rank: Regular Contributor
timestamp: June 14, 2016, 01:26:12 pm
content: Are you kidding? BASIC, easy syntax? Not at all. Learning C, no problem. Learning Verilog, no problem. VHDL, syntax get a little bit crank up. But Basic, and the like (Visual basic), the syntax is weird. C only got a very few keyword (including char, int and the other type, if, else, while, for, switch, void, return, and the other keyword more rarely used). For the semi-colon, you just put one at the end of each statement. The hardest thing to understand in C is the pointer concept. But even that is not that hard. If we compare Basic with that, it has the same complexity : lot of keyword to remember, where do we put the $ sign, before of after? I see both :https://en.wikipedia.org/wiki/BASIC, i also see weird semi-colon placement, and lastly, I see some strange keyword that doesn't exist in other more structured language, like the left keyword. Oh, and I see goto most everywhere in most Basic stuff... Basic teach bad habit. Even if we can write structured Basic, most of the literature is tainted with goto. Visual Basic is almost even worse (strange keyword, strange structure, strange data type). Is C harder than Basic or visual basic, I strongly say no. Personally I find it easier than most other language, but this is a personal taste, but it is definitely not harder. It all come to one important sentence : pick your poison.Code:10 INPUT "What is your name: "; U$20 PRINT "Hello "; U$30 INPUT "How many stars do you want: "; N40 S$ = ""50 FOR I = 1 TO N60 S$ = S$ + "*"70 NEXT I80 PRINT S$90 INPUT "Do you want more stars? "; A$100 IF LEN(A$) = 0 THEN GOTO 90110 A$ = LEFT$(A$, 1)120 IF A$ = "Y" OR A$ = "y" THEN GOTO 30130 PRINT "Goodbye "; U$140 ENDOh, and the point that given birth to this reply is the guy that talked about basic and datatype, everything float and ... Well, knowing your datatype is very important. If you exchange information between 2 device, you need to know how the information will be stored at each end, or else, it won't work as expected.

author: System Error Message
author_rank: Frequent Contributor
timestamp: June 14, 2016, 01:33:13 pm
content: There are many alternatives, you can always contact a company that makes them and order some chips. The reason why you dont see much mention of alternatives is because arduino covers a wide range of commonly used general purpose controllers in a convenient way including the IDE and compiler. You can even use java for it.You can also use FPGAs too.There are many many controllers/chips but they dont usually come on a board with all the IO and stuff ready with an IDE like arduino has. Udoo for example doesnt actually use arduino, it uses arduino compatible chips as the chips they use arent exactly the same.

author: BloodyCactus
author_rank: Frequent Contributor
timestamp: June 14, 2016, 03:56:47 pm
content: ugh so many confused concepts in here. dividing signed integers by 65536, now shifting them by 16 (go undefined behaviour!) conversion to doubles. on an 8bit mcu that does floating point in software. ugh.Marty, find a good C beginner tutorial on types and their sizes and try and understand what exactly you are doing.

author: mikerj
author_rank: Super Contributor
timestamp: June 14, 2016, 06:01:52 pm
content: Quote from: BloodyCactus on June 14, 2016, 03:56:47 pmThe suggested code had a right shift on a signed integer, so it is implementation-defined behaviour rather than undefined.

author: Ian.M
author_rank: Super Contributor
timestamp: June 14, 2016, 06:39:42 pm
content: Why would you suspect the O.P'spwmstepwhich he's using for the duty cycle of a 16 bit PWM, to be signed? That would be idiosyncratic in the extreme. As long aspwmstepis unsigned, multiplying by an unsigned long constant will promote to unsigned long, so the right shift will have a well defined result as long as the platform uses 32 bit or larger longs. Sizeof(long) is 4 under AVR GCC, unless the non-ANSI compilant switch -mint8 is used.

author: zapta
author_rank: Super Contributor
timestamp: June 14, 2016, 06:51:59 pm
content: Quote from: marty on June 12, 2016, 09:35:00 pmThese looks like basic linear scalings. Have you look at this Arduino function?https://www.arduino.cc/en/Reference/Map

author: marty
author_rank: Contributor
timestamp: June 14, 2016, 08:11:01 pm
content: Quote from: sleemanj on June 14, 2016, 06:14:09 amArduino is a software brand, just using it's name on hardware.

author: marty
author_rank: Contributor
timestamp: June 14, 2016, 08:12:46 pm
content: Quote from: asgard20032 on June 14, 2016, 01:26:12 pmyou realize I used to program that way in 1983.. nice simple and this fourm would actually be more like RBBS

author: richardman
author_rank: Frequent Contributor
timestamp: June 14, 2016, 08:50:29 pm
content: This is like the worst thread possible in the number of answers ;-)

author: NivagSwerdna
author_rank: Super Contributor
timestamp: June 14, 2016, 09:20:18 pm
content: Quote from: richardman on June 14, 2016, 08:50:29 pmThis thread is the worst ever. It started because the OP can't write code in C. It has nothing to do with Arduino.

author: hamster_nz
author_rank: Super Contributor
timestamp: June 14, 2016, 10:00:03 pm
content: Quote from: Bruce Abbott on June 14, 2016, 12:10:28 pmHave a play with Scratch (http://scratch.mit.edu), if only for a few minutes. No, really just do it. Scratch for Arduino is what is really needed for newbies.Oh, and I Google for 5 seconds...http://s4a.cat/S4A is a Scratch modification that allows for simple programming of the Arduino open source hardware platform. It provides new blocks for managing sensors and actuators connected to Arduino.(I teach Scratch it at a local CodeClub)

author: ebclr
author_rank: Super Contributor
timestamp: June 15, 2016, 03:44:04 am
content: Also have another option more on graphic side instead of hard C codehttp://www.mitov.com/products/visuino#overviewI personally prefer C, but not everybody is the same taste

author: CatalinaWOW
author_rank: Super Contributor
timestamp: June 15, 2016, 04:23:00 am
content: The OP may have nailed the Arduino problem when he described the responses he got on Arduino bulletin boards. The problem is not the microcontroller, or the language. The problem is that the ease of use of Arduino has allowed a lot of people who don't really know what they are doing to accomplish things, thus validating themselves as "experts". Just about any other platform (with the possible exception of Stamp) would be better in this sense.That said, I like Arduino. Easy to get fast prototypes slapped together to evaluate user response, learn what you didn't know about the environment and requirements and so on. And it is so cheap that it doesn't even make sense to clean it up unless you are building quite a few. Just recognize that there is a lot of clunker advice and bad examples out there in the Arduino universe.

author: ebclr
author_rank: Super Contributor
timestamp: June 15, 2016, 04:56:34 am
content: It's interesting.I'm from the famous 80C31 time, and I prefer to use Atmel IDE than arduino, because the arduino Layer make things easier on one side, but make blinded developers on the other one, I still prefer to stay in ASM, C or even pascal with Microe compiler, arduino only to CRTL C CTRL V internet projects. Actually all my eyes in on Psoc or FPGA everything else decrease value for me

author: autobot
author_rank: Regular Contributor
timestamp: June 15, 2016, 09:02:14 am
content: Quote from: CatalinaWOW on June 15, 2016, 04:23:00 amThat's true.I actually think the mbed walks the fine line pretty well here: On the other hand, it's more complex than the Arduino so that deters the Arduino crowd, but once you pass the learning barrier(which isn't that big ), you get to prototype probably as fast as the arduino(and maybe even faster for some things, like power management) , and yet get to have a platform that could take you to production in many cases.

author: Buriedcode
author_rank: Super Contributor
timestamp: June 15, 2016, 11:21:56 am
content: As with many disciplines there are almost always gaps in knowledge, and as CatalinaWOW pointed out, writing a few lines of code that use prebuilt libraries does gives some the sense they are 'good at coding for microcontrollers' - with all manner of cool things happening, but with very little 'logic' being written. I see it quite often with those with IT backgrounds starting to do embedded stuff - easily tripped up by things they take for granted on larger CPU's with seemingly endless resources. Those are then countered by what some have called the 'bare metal zealots' who go as far as to say you should code in assembly...To the op. If you're a software guy I'm sure you're used to writing down exactly what you want to do in flow chart format, and used to using equations. What I think has tripped you up here is that you're dealing with an 8-bit device which has limitations, and therefore can require a different approach to how you do things, to achieve the desired effect.I was surprised when you said you had realised that right shifting a value (unsigned long) by 16 divides it by 65536 (similarlly left shifting multiples it). The same reason that left shifting a decmial number by 1 multiplies it by 10. Because its an 8-bit device, it stores a 32-bit number in 4 locations, so it doesn't even need to shift any bits for that - it just takes the top two bytes and discards the bottom two. And this is where I believe quite a few people get stuck... bytes, chars, ints, words, longs etc.. are of course finite, whilst I'm sure many software people are aware of this, for micro's, often one needs more than just 'awareness' of logical functions and how the mathematical operations are actually performed on hardware. You may not need it to be fast, and higher level languages give you the option of using floats, dealing with very precise numbers, but what if you're trying to make something use less power? or perform that calculation a thousand times a second? It seems a common approach these days is to 'use a bigger chip'.That is often why multiplications and divisions for things like averaging, are done to the power of two - to make it much easier for a chip without dedicated division hardware to divide a number. It simply becomes a case of barrel shifting.As for your project, it would help if you explained in your first post, what it is you're trying to achieve, and what you have tried so far. We've all been 'peeved' when the software we've written doesn't do as we expected, but in every single case - it was my mistake and lack of understanding. (with the possible exception of a tiny bug in MikroC PRO that caused an if statement to always execute..).

author: westfw
author_rank: Super Contributor
timestamp: June 15, 2016, 10:10:21 pm
content: QuoteThat isquite uncertain. Not all BASIC implementations implement floating point, and some require explicit declarations of floats vs integers/Running floating point "all the time" on an 8bit CPU is not a great recipe for "product success." You can tell from all the BASIC52 based boards that are still widely used (not!) There are significant size and speed issues.Ditto for a bunch of the other "higher level" languages.OTOH, if the original code had been written on an ARM variant of "something", the OP might never have noticed assorted integer length issues, since they would have been 32bits instead of 16... The whole "expressions involving constants may be computed using 16bit integers" is one of the biggest traps that catches "somewhat experienced" programmers on Arduino, and it's not Arduino's "fault" (it doesn't happen in the vast majority of C-like environments, because ... 32bit ints.)

author: Ian.M
author_rank: Super Contributor
timestamp: June 15, 2016, 11:19:30 pm
content: Quote from: westfw on June 15, 2016, 10:10:21 pm^*THIS*^To not be caught out by the standard compliant minimum integer length trap, you need to either be *much* smarter than the average bear, or to have a background in programming 8 or 16 bit embedded systems in C, or to have been a C programmer long enough to have welcomed in the ANSI C89 standard! One more generation, and there will be very few people left from the K&R C era still coding . . . . . .

author: System Error Message
author_rank: Frequent Contributor
timestamp: June 16, 2016, 12:55:08 am
content: Just some things you can do with microcontrollers.

author: marty
author_rank: Contributor
timestamp: June 20, 2016, 10:08:43 pm
content: Just remember this is an entry point platform..We must first roll,crawl,walk, and run in due time.Seeing a post on an Arduino question shouldn't get a PhD response.

author: nikodean1
author_rank: Newbie
timestamp: June 27, 2016, 01:56:42 pm
content: Texas Instruments has some models that offer lots of processing power and flash memory for the price, but Arduino appears to have a much larger community to support it (and you're going to appreciate the abundance of tutorials and code samples available for them. Although, to be fair to TI, the Hercules models can be used with HALCoGen, which provides great libraries and a GUI which can save you some work (for example, you can generate a PWM signal with just a few clicks), and typing basically one line of code.

author: ez24
author_rank: Super Contributor
timestamp: June 28, 2016, 04:49:47 am
content: Quote from: marty on June 20, 2016, 10:08:43 pmDon't worry - this is normal on this forum.I think there are a lot of PhDs here.

author: stj
author_rank: Super Contributor
timestamp: June 29, 2016, 01:57:49 am
content: i say get a Nucleo board.the 64pin ones are cheaper than arduino with onboard usb programmer and debug unit.the best 144pin F767zi board is 200MHz and has hardware double-precision floating point math hardware and 2meg of flash.and still only costs about $20

author: ez24
author_rank: Super Contributor
timestamp: June 29, 2016, 02:20:58 am
content: Quote from: stj on June 29, 2016, 01:57:49 amThere is a 500+ page book written by a forum member who uses the Nucleo-64 as the tool used in the book.https://leanpub.com/mastering-stm32There are some sample pages available

author: westfw
author_rank: Super Contributor
timestamp: June 29, 2016, 08:09:53 am
content: QuoteAre there similar books for any other vendors' ARM chips?https://www.amazon.com/Embedded-Systems-Introduction-Cortex-Microcontrollers/dp/1477508996/Might work for the TI Tiva chips?