Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #545211 > unrolled thread
| Started by | Terry Pinnell <me@somewhere.invalid> |
|---|---|
| First post | 2019-05-31 11:48 +0100 |
| Last post | 2019-06-02 23:40 -0400 |
| Articles | 20 on this page of 116 — 24 participants |
Back to article view | Back to sci.electronics.design
Arduino code sources? Terry Pinnell <me@somewhere.invalid> - 2019-05-31 11:48 +0100
Re: Arduino code sources? Cursitor Doom <curd@notformail.com> - 2019-05-31 11:40 +0000
Re: Arduino code sources? Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-05-31 05:32 -0700
Re: Arduino code sources? Winfield Hill <hill@rowland.harvard.edu> - 2019-05-31 06:54 -0700
Re: Arduino code sources? bitrex <user@example.net> - 2019-05-31 10:46 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-05-31 10:47 -0400
Re: Arduino code sources? Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-05-31 07:49 -0700
Re: Arduino code sources? Peter Percival <peterxpercival@hotmail.com> - 2019-06-12 13:41 +0100
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-12 21:48 -0400
Re: Arduino code sources? Peter Percival <peterxpercival@hotmail.com> - 2019-06-13 17:46 +0100
Re: Arduino code sources? George Herold <gherold@teachspin.com> - 2019-05-31 07:45 -0700
Re: Arduino code sources? bitrex <user@example.net> - 2019-05-31 11:37 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-05-31 11:39 -0400
Re: Arduino code sources? Terry Pinnell <me@somewhere.invalid> - 2019-05-31 18:13 +0100
Re: Arduino code sources? Ralph Mowery <rmowery28146@earthlink.net> - 2019-05-31 15:07 -0400
Re: Arduino code sources? "John Miles, KE5FX" <jmiles@gmail.com> - 2019-05-31 17:02 -0700
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-01 04:57 +0000
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-01 01:11 -0400
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-01 05:56 +0000
Re: Arduino code sources? "John Miles, KE5FX" <jmiles@gmail.com> - 2019-05-31 23:34 -0700
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-01 07:34 +0000
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-01 06:39 -0400
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-01 07:50 +0100
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-01 07:17 +0000
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-01 06:45 -0400
Re: Arduino code sources? DecadentLinuxUserNumeroUno@decadence.org - 2019-06-01 11:13 +0000
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-01 21:06 +1000
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-01 12:33 +0100
Re: Arduino code sources? DecadentLinuxUserNumeroUno@decadence.org - 2019-06-01 12:03 +0000
Re: Arduino code sources? Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-06-01 05:15 -0700
Re: Arduino code sources? DecadentLinuxUserNumeroUno@decadence.org - 2019-06-02 01:48 +0000
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-01 11:26 -0400
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-01 19:03 +0100
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-01 19:56 -0400
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-02 01:13 +0100
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-02 20:09 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-02 20:16 -0400
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-03 11:10 +1000
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-02 22:26 -0400
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-03 12:37 +1000
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-02 23:14 -0400
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-03 14:30 +1000
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-03 08:46 +0100
Re: Arduino code sources? DecadentLinuxUserNumeroUno@decadence.org - 2019-06-03 11:58 +0000
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-01 17:18 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-01 17:24 -0400
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-01 20:08 -0400
Re: Arduino code sources? Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-06-01 17:14 -0700
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-01 20:26 -0400
Re: Arduino code sources? "Rodney Pont" <mlist4@infohit.me.uk> - 2019-06-01 15:19 +0100
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-02 17:42 +1000
Re: Arduino code sources? "John Miles, KE5FX" <jmiles@gmail.com> - 2019-06-02 01:53 -0700
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-02 22:46 +1000
Re: Arduino code sources? Dennis <dennis@none.none> - 2019-06-01 09:43 -0500
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-01 11:30 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-03 00:00 -0400
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-03 05:52 +0000
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-03 11:33 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-03 11:41 -0400
Re: Arduino code sources? pcdhobbs@gmail.com - 2019-06-03 16:29 -0700
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-04 02:14 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-04 02:27 -0400
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-03 08:50 +0100
Re: Arduino code sources? krw@notreal.com - 2019-06-03 19:12 -0400
Spot the app note error was Arduino code sources? Don Kuenz, KB7RPU <g@crcomp.net> - 2019-06-04 16:03 +0000
Re: Spot the app note error was Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-04 13:17 -0400
Re: Spot the app note error Don Kuenz <g@crcomp.net> - 2019-06-04 21:47 +0000
Re: Spot the app note error was Arduino code sources? Don Kuenz <g@crcomp.net> - 2019-06-08 18:34 +0000
Re: Spot the app note error was Arduino code sources? bitrex <user@example.net> - 2019-06-04 15:30 -0400
Re: Spot the app note error Don Kuenz, KB7RPU <g@crcomp.net> - 2019-06-04 21:48 +0000
Re: Spot the app note error Winfield Hill <winfieldhill@yahoo.com> - 2019-06-04 15:51 -0700
Re: Spot the app note error Don Kuenz, KB7RPU <g@crcomp.net> - 2019-06-04 23:28 +0000
Re: Spot the app note error Don Kuenz, KB7RPU <g@crcomp.net> - 2019-06-04 23:40 +0000
Re: Spot the app note error Winfield Hill <winfieldhill@yahoo.com> - 2019-06-04 17:21 -0700
Re: Spot the app note error Don Kuenz, KB7RPU <g@crcomp.net> - 2019-06-05 01:13 +0000
Re: Spot the app note error bitrex <user@example.net> - 2019-06-04 23:02 -0400
Re: Spot the app note error bitrex <user@example.net> - 2019-06-04 23:05 -0400
Re: Spot the app note error Winfield Hill <winfieldhill@yahoo.com> - 2019-06-05 01:08 -0700
Re: Spot the app note error bitrex <user@example.net> - 2019-06-06 00:22 -0400
Re: Spot the app note error bitrex <user@example.net> - 2019-06-06 00:27 -0400
Re: Spot the app note error Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-05 22:48 -0400
Re: Spot the app note error Winfield Hill <winfieldhill@yahoo.com> - 2019-06-07 13:35 -0700
Re: Spot the app note error Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-07 20:44 -0400
Re: Arduino code sources? Cursitor Doom <curd@notformail.com> - 2019-06-01 09:57 +0000
Re: Arduino code sources? Cursitor Doom <curd@notformail.com> - 2019-06-01 10:06 +0000
Re: Arduino code sources? "John Miles, KE5FX" <jmiles@gmail.com> - 2019-06-01 15:06 -0700
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-02 03:26 +0000
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-02 17:55 +1000
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-02 09:39 +0000
Re: Arduino code sources? DecadentLinuxUserNumeroUno@decadence.org - 2019-06-02 11:02 +0000
Re: Arduino code sources? Cursitor Doom <curd@notformail.com> - 2019-06-02 11:43 +0000
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-02 22:57 +1000
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-02 15:05 +0000
Re: Arduino code sources? Cursitor Doom <curd@notformail.com> - 2019-06-02 17:00 +0000
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-03 10:07 +1000
Re: Arduino code sources? Jasen Betts <jasen@xnet.co.nz> - 2019-06-03 00:55 +0000
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-03 05:22 +0000
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-03 11:00 +1000
Re: Arduino code sources? Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2019-06-03 05:21 +0000
Re: Arduino code sources? Clifford Heath <no.spam@please.net> - 2019-06-03 17:15 +1000
Re: Arduino code sources? Cursitor Doom <curd@notformail.com> - 2019-06-02 15:23 +0000
Re: Arduino code sources? Rheilly Phoull <rheilly@bigslong.com> - 2019-06-01 08:13 +0800
Re: Arduino code sources? sdy <sdeyoreo@hotmail.com> - 2019-05-31 18:38 -0700
Re: Arduino code sources? Terry Pinnell <me@somewhere.invalid> - 2019-06-01 11:45 +0100
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-01 12:36 +0100
Re: Arduino code sources? Terry Pinnell <me@somewhere.invalid> - 2019-06-01 16:04 +0100
Re: Arduino code sources? Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-06-01 04:38 -0700
Re: Arduino code sources? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-06-01 11:32 -0400
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-01 19:05 +0100
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-02 23:52 -0400
Re: Arduino code sources? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-06-03 08:53 +0100
Re: Arduino code sources? Ralph Mowery <rmowery28146@earthlink.net> - 2019-06-01 11:26 -0400
Re: Arduino code sources? "Rodney Pont" <mlist4@infohit.me.uk> - 2019-06-01 15:11 +0100
Re: Arduino code sources? Terry Pinnell <me@somewhere.invalid> - 2019-06-01 16:20 +0100
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-02 23:08 -0400
Re: Arduino code sources? bitrex <user@example.net> - 2019-06-02 23:40 -0400
Page 3 of 6 — ← Prev page 1 2 [3] 4 5 6 Next page →
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-06-02 23:14 -0400 |
| Message-ID | <Zf0JE.71808$gN3.12675@fx09.iad> |
| In reply to | #545663 |
On 6/2/19 10:37 PM, Clifford Heath wrote: > On 3/6/19 12:26 pm, bitrex wrote: >> On 6/2/19 9:10 PM, Clifford Heath wrote: >>> I've just hand-built a Makefile for a client's SAMD Arduino project >> Large projects I write, prototype and debug all the algorithms and >> classes and components, in portable C++, as if I'm writing an >> application for a desktop x86 machine. > > So would I, but that would cover less than a third of the code in this > case, since it's all about hardware access (I2S links to feed audio to a > 3G modem, etc) and that's where the bugs are. It probably should have > better device driver testing, but it is what it is, not by my choice. > >> ...if I'm unsure of what kind of code will be generated. > > Absolutely no need for that in this case. > >> avr-gcc and arm-gcc tend to generate very compact code, even from >> template-heavy C++11. > > Yes, exactly. > >> Obviously keeping in mind the resource limitations of the processor it >> will end up running on. > > Plenty of grunt here. This processor was chosen for its peripherals. > >> C++ doesn't support... >> It's good programming practice to... >> in C++ it's very straightforward to... > Please, save your programming advice for someone who needs it :) The OP > is trying to climb the hill of his first embedded C. More advanced > lessons can come later, but I wanted him to know that Arduino has > definite downsides! Atmel Studio is a much better option. > > Clifford Heath. "Arduino" is just an API. The Arduino-provided IDE sux balls. But you can use the processor-specific API with an IDE of your choice though, with a little work, just so you can use e.g. digitalWrite, analogRead, Serial.begin etc. and not have to muck with setting up all the registers and interrupts yourself. For many (even "professional") projects they're fine. So maybe digitalWrite sometimes takes 100 clock cycles. BFD. Fix it if/when you know you need to flip the pins faster.
[toc] | [prev] | [next] | [standalone]
| From | Clifford Heath <no.spam@please.net> |
|---|---|
| Date | 2019-06-03 14:30 +1000 |
| Message-ID | <hn1JE.48729$KA4.20612@fx05.iad> |
| In reply to | #545666 |
On 3/6/19 1:14 pm, bitrex wrote: > "Arduino" is just an API. The Arduino-provided IDE sux balls. But you > can use the processor-specific API with an IDE of your choice though, > with a little work, just so you can use e.g. digitalWrite, analogRead, > Serial.begin etc. and not have to muck with setting up all the registers > and interrupts yourself. For many (even "professional") projects they're > fine. So maybe digitalWrite sometimes takes 100 clock cycles. BFD. Fix > it if/when you know you need to flip the pins faster. Atmel Studio has a much better and more complete API (the ASF), much better implemented. It's a no-contest if you're on a supported MCU.
[toc] | [prev] | [next] | [standalone]
| From | Tom Gardner <spamjunk@blueyonder.co.uk> |
|---|---|
| Date | 2019-06-03 08:46 +0100 |
| Message-ID | <Ze4JE.561232$X23.287642@fx38.am4> |
| In reply to | #545679 |
On 03/06/19 05:30, Clifford Heath wrote: > On 3/6/19 1:14 pm, bitrex wrote: >> "Arduino" is just an API. The Arduino-provided IDE sux balls. But you can use >> the processor-specific API with an IDE of your choice though, with a little >> work, just so you can use e.g. digitalWrite, analogRead, Serial.begin etc. and >> not have to muck with setting up all the registers and interrupts yourself. >> For many (even "professional") projects they're fine. So maybe digitalWrite >> sometimes takes 100 clock cycles. BFD. Fix it if/when you know you need to >> flip the pins faster. > > Atmel Studio has a much better and more complete API (the ASF), much better > implemented. It's a no-contest if you're on a supported MCU. And peripherals / shields. And ecosystem including libraries and users. (And operating system) Beginners use arduino to glue bits together in simple ways. It is /sufficient/ for that. Apart from that, I'm not going to defend arduinos.
[toc] | [prev] | [next] | [standalone]
| From | DecadentLinuxUserNumeroUno@decadence.org |
|---|---|
| Date | 2019-06-03 11:58 +0000 |
| Message-ID | <qd3208$lkr$2@gioia.aioe.org> |
| In reply to | #545687 |
Tom Gardner <spamjunk@blueyonder.co.uk> wrote in news:Ze4JE.561232$X23.287642@fx38.am4: > On 03/06/19 05:30, Clifford Heath wrote: >> On 3/6/19 1:14 pm, bitrex wrote: >>> "Arduino" is just an API. The Arduino-provided IDE sux balls. >>> But you can use the processor-specific API with an IDE of your >>> choice though, with a little work, just so you can use e.g. >>> digitalWrite, analogRead, Serial.begin etc. and not have to muck >>> with setting up all the registers and interrupts yourself. For >>> many (even "professional") projects they're fine. So maybe >>> digitalWrite sometimes takes 100 clock cycles. BFD. Fix it >>> if/when you know you need to flip the pins faster. >> >> Atmel Studio has a much better and more complete API (the ASF), >> much better implemented. It's a no-contest if you're on a >> supported MCU. > > And peripherals / shields. > And ecosystem including libraries and users. > (And operating system) > > Beginners use arduino to glue bits together in simple ways. > It is /sufficient/ for that. > > Apart from that, I'm not going to defend arduinos. Get REAL work done... <https://www.solid-run.com/>
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-06-01 17:18 -0400 |
| Message-ID | <EYBIE.17540$x14.36@fx29.iad> |
| In reply to | #545420 |
On 6/1/19 11:26 AM, Phil Hobbs wrote: > On 6/1/19 7:33 AM, Tom Gardner wrote: >> On 01/06/19 12:06, Clifford Heath wrote: >>> On 1/6/19 4:50 pm, Tom Gardner wrote: >>>> What you gain on the swings you lose on the roundabouts. >>>> >>>> While I am certainly no fan of C++ (e.g. see the C++ FQA), >>>> one advantage of the Arduino class machines is that you are >>>> programming against bare silicon. >>> >>> If you think that 120 CPU cycles to set or clear a port pin is "bare >>> silicon" then I don't know what to think. That's how long >>> "digitalWrite" takes to perform a 2-cycle operation. >> >> Rank beginners, such as the OP, doing blinkies and >> the like won't be affected by that. >> >> >>> The Arduino C libraries are a really bad direction to start off in, >>> even for a raw beginner. They are so unnecessarily so very badly >>> implemented. >> >> No way am I going to defend Arduino for people that >> know what they are doing. >> >> But for rank beginners, they offer a low cost of entry >> and gentle learning curve. That's valuable in those >> circumstances. >> >> Only after they even notice the limitations, will they be >> in a position to do something about it. >> >> >>>> Having an operating system in a hard real-time system can >>>> be a real impediment and a steep learning curve. >> >> >> >> > Except for the lack of a debugger. Arduino may be C++ish, but its > debugging is strictly 1965. > > Cheers > > Phil Hobbs > aside from the maybe 2-5% of a code that's uP-specific I generally just sketch out all the functional blocks and algorithms as if I'm writing and debugging a console application and do any required debugging on the desktop IDE, using a set of stem functions for the implementation-specific uP stuff. Then just port the code like any other code-porting job. If you've kept the capabilities of your target hardware in mind wrt resources and clock speed etc. generally it basically works first time and the rest is performance tuning, not head-scratching trying to debug why some untested algorithm isn't working on the 8 or 32 bit bare-metal processor itself. It's what using a portable language is all about really!
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-06-01 17:24 -0400 |
| Message-ID | <r2CIE.40707$jz4.23807@fx06.iad> |
| In reply to | #545459 |
On 6/1/19 5:18 PM, bitrex wrote: > On 6/1/19 11:26 AM, Phil Hobbs wrote: >> On 6/1/19 7:33 AM, Tom Gardner wrote: >>> On 01/06/19 12:06, Clifford Heath wrote: >>>> On 1/6/19 4:50 pm, Tom Gardner wrote: >>>>> What you gain on the swings you lose on the roundabouts. >>>>> >>>>> While I am certainly no fan of C++ (e.g. see the C++ FQA), >>>>> one advantage of the Arduino class machines is that you are >>>>> programming against bare silicon. >>>> >>>> If you think that 120 CPU cycles to set or clear a port pin is "bare >>>> silicon" then I don't know what to think. That's how long >>>> "digitalWrite" takes to perform a 2-cycle operation. >>> >>> Rank beginners, such as the OP, doing blinkies and >>> the like won't be affected by that. >>> >>> >>>> The Arduino C libraries are a really bad direction to start off in, >>>> even for a raw beginner. They are so unnecessarily so very badly >>>> implemented. >>> >>> No way am I going to defend Arduino for people that >>> know what they are doing. >>> >>> But for rank beginners, they offer a low cost of entry >>> and gentle learning curve. That's valuable in those >>> circumstances. >>> >>> Only after they even notice the limitations, will they be >>> in a position to do something about it. >>> >>> >>>>> Having an operating system in a hard real-time system can >>>>> be a real impediment and a steep learning curve. >>> >>> >>> >>> >> Except for the lack of a debugger. Arduino may be C++ish, but its >> debugging is strictly 1965. >> >> Cheers >> >> Phil Hobbs >> > > aside from the maybe 2-5% of a code that's uP-specific I generally just > sketch out all the functional blocks and algorithms as if I'm writing > and debugging a console application and do any required debugging on the > desktop IDE, using a set of stem functions for the > implementation-specific uP stuff. > > Then just port the code like any other code-porting job. If you've kept > the capabilities of your target hardware in mind wrt resources and clock > speed etc. generally it basically works first time and the rest is > performance tuning, not head-scratching trying to debug why some > untested algorithm isn't working on the 8 or 32 bit bare-metal processor > itself. It's what using a portable language is all about really! premature optimization is the ROOT OF ALL EVIL and even most realtime uP applications do not have to be written in hand-coded ASM or C like everything needs blazing performance. The bulk of it can be just written in friendly object-oriented design patterns using most of the same niceties you have when writing a console application for a desktop.
[toc] | [prev] | [next] | [standalone]
| From | Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> |
|---|---|
| Date | 2019-06-01 20:08 -0400 |
| Message-ID | <qcv42g$6ok$1@dont-email.me> |
| In reply to | #545460 |
On 6/1/19 5:24 PM, bitrex wrote: > On 6/1/19 5:18 PM, bitrex wrote: >> On 6/1/19 11:26 AM, Phil Hobbs wrote: >>> On 6/1/19 7:33 AM, Tom Gardner wrote: >>>> On 01/06/19 12:06, Clifford Heath wrote: >>>>> On 1/6/19 4:50 pm, Tom Gardner wrote: >>>>>> What you gain on the swings you lose on the roundabouts. >>>>>> >>>>>> While I am certainly no fan of C++ (e.g. see the C++ FQA), >>>>>> one advantage of the Arduino class machines is that you are >>>>>> programming against bare silicon. >>>>> >>>>> If you think that 120 CPU cycles to set or clear a port pin is >>>>> "bare silicon" then I don't know what to think. That's how long >>>>> "digitalWrite" takes to perform a 2-cycle operation. >>>> >>>> Rank beginners, such as the OP, doing blinkies and >>>> the like won't be affected by that. >>>> >>>> >>>>> The Arduino C libraries are a really bad direction to start off in, >>>>> even for a raw beginner. They are so unnecessarily so very badly >>>>> implemented. >>>> >>>> No way am I going to defend Arduino for people that >>>> know what they are doing. >>>> >>>> But for rank beginners, they offer a low cost of entry >>>> and gentle learning curve. That's valuable in those >>>> circumstances. >>>> >>>> Only after they even notice the limitations, will they be >>>> in a position to do something about it. >>>> >>>> >>>>>> Having an operating system in a hard real-time system can >>>>>> be a real impediment and a steep learning curve. >>>> >>>> >>>> >>>> >>> Except for the lack of a debugger. Arduino may be C++ish, but its >>> debugging is strictly 1965. >>> >>> Cheers >>> >>> Phil Hobbs >>> >> >> aside from the maybe 2-5% of a code that's uP-specific I generally >> just sketch out all the functional blocks and algorithms as if I'm >> writing and debugging a console application and do any required >> debugging on the desktop IDE, using a set of stem functions for the >> implementation-specific uP stuff. >> >> Then just port the code like any other code-porting job. If you've >> kept the capabilities of your target hardware in mind wrt resources >> and clock speed etc. generally it basically works first time and the >> rest is performance tuning, not head-scratching trying to debug why >> some untested algorithm isn't working on the 8 or 32 bit bare-metal >> processor itself. It's what using a portable language is all about >> really! > > premature optimization is the ROOT OF ALL EVIL and even most realtime uP > applications do not have to be written in hand-coded ASM or C like > everything needs blazing performance. So what are you going to use on an ATmega, python 3 and MariaDB maybe? > The bulk of it can be just written in friendly object-oriented design > patterns using most of the same niceties you have when writing a console > application for a desktop. Niceties = subtleties, not nice things. ;) Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com
[toc] | [prev] | [next] | [standalone]
| From | Lasse Langwadt Christensen <langwadt@fonz.dk> |
|---|---|
| Date | 2019-06-01 17:14 -0700 |
| Message-ID | <61215ab2-872b-47f4-8fd0-7896ddb8b187@googlegroups.com> |
| In reply to | #545480 |
søndag den 2. juni 2019 kl. 02.08.52 UTC+2 skrev Phil Hobbs: > On 6/1/19 5:24 PM, bitrex wrote: > > On 6/1/19 5:18 PM, bitrex wrote: > >> On 6/1/19 11:26 AM, Phil Hobbs wrote: > >>> On 6/1/19 7:33 AM, Tom Gardner wrote: > >>>> On 01/06/19 12:06, Clifford Heath wrote: > >>>>> On 1/6/19 4:50 pm, Tom Gardner wrote: > >>>>>> What you gain on the swings you lose on the roundabouts. > >>>>>> > >>>>>> While I am certainly no fan of C++ (e.g. see the C++ FQA), > >>>>>> one advantage of the Arduino class machines is that you are > >>>>>> programming against bare silicon. > >>>>> > >>>>> If you think that 120 CPU cycles to set or clear a port pin is > >>>>> "bare silicon" then I don't know what to think. That's how long > >>>>> "digitalWrite" takes to perform a 2-cycle operation. > >>>> > >>>> Rank beginners, such as the OP, doing blinkies and > >>>> the like won't be affected by that. > >>>> > >>>> > >>>>> The Arduino C libraries are a really bad direction to start off in, > >>>>> even for a raw beginner. They are so unnecessarily so very badly > >>>>> implemented. > >>>> > >>>> No way am I going to defend Arduino for people that > >>>> know what they are doing. > >>>> > >>>> But for rank beginners, they offer a low cost of entry > >>>> and gentle learning curve. That's valuable in those > >>>> circumstances. > >>>> > >>>> Only after they even notice the limitations, will they be > >>>> in a position to do something about it. > >>>> > >>>> > >>>>>> Having an operating system in a hard real-time system can > >>>>>> be a real impediment and a steep learning curve. > >>>> > >>>> > >>>> > >>>> > >>> Except for the lack of a debugger. Arduino may be C++ish, but its > >>> debugging is strictly 1965. > >>> > >>> Cheers > >>> > >>> Phil Hobbs > >>> > >> > >> aside from the maybe 2-5% of a code that's uP-specific I generally > >> just sketch out all the functional blocks and algorithms as if I'm > >> writing and debugging a console application and do any required > >> debugging on the desktop IDE, using a set of stem functions for the > >> implementation-specific uP stuff. > >> > >> Then just port the code like any other code-porting job. If you've > >> kept the capabilities of your target hardware in mind wrt resources > >> and clock speed etc. generally it basically works first time and the > >> rest is performance tuning, not head-scratching trying to debug why > >> some untested algorithm isn't working on the 8 or 32 bit bare-metal > >> processor itself. It's what using a portable language is all about > >> really! > > > > premature optimization is the ROOT OF ALL EVIL and even most realtime uP > > applications do not have to be written in hand-coded ASM or C like > > everything needs blazing performance. > > So what are you going to use on an ATmega, python 3 and MariaDB maybe? > not enough layers of abstraction and interpretation to be considered cool ;)
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-06-01 20:26 -0400 |
| Message-ID | <DIEIE.22786$923.6876@fx23.iad> |
| In reply to | #545480 |
On 6/1/19 8:08 PM, Phil Hobbs wrote: >>> Then just port the code like any other code-porting job. If you've >>> kept the capabilities of your target hardware in mind wrt resources >>> and clock speed etc. generally it basically works first time and the >>> rest is performance tuning, not head-scratching trying to debug why >>> some untested algorithm isn't working on the 8 or 32 bit bare-metal >>> processor itself. It's what using a portable language is all about >>> really! >> >> premature optimization is the ROOT OF ALL EVIL and even most realtime >> uP applications do not have to be written in hand-coded ASM or C like >> everything needs blazing performance. > > So what are you going to use on an ATmega, python 3 and MariaDB maybe? Use C++, but like modern C++ with templates and namespaces and interfaces and iterators and like, an actual structured approach to object-oriented design, not just C code farmed out into class functions. It all works out fine with avr-gcc for an ATMega, even. Nah just using those features doesn't bloat the code or make it slow intrinsically, it's very close to zero overhead abstraction and can often reduce codebase size. Using heavyweight algorithms or containers like std::string, or arduino String, or vectors or tree-based data structures like maps would require a very good reason on a platform like that, though.
[toc] | [prev] | [next] | [standalone]
| From | "Rodney Pont" <mlist4@infohit.me.uk> |
|---|---|
| Date | 2019-06-01 15:19 +0100 |
| Message-ID | <nfcnzbgcqvasbuvgzrhx.psfpoy1.pminews@ouse.infohit.me.uk> |
| In reply to | #545397 |
On Sat, 1 Jun 2019 21:06:36 +1000, Clifford Heath wrote: >The Arduino C libraries are a really bad direction to start off in, even >for a raw beginner. They are so unnecessarily so very badly implemented. A lot of the C/C++ libraries seem to have been written by people who are out to prove how clever they are. Some I understood what they were doing and managed to use them but there were a lot more that just didn't have sufficiently clear documentation for me to use them. I've been using 'objects' for nearly thirty years and get along with them but I found it hard to understand how the developer got from there to here if you see what I mean. -- Regards - Rodney Pont The from address exists but is mostly dumped, please send any emails to the address below e-mail rpont (at) gmail (dot) com
[toc] | [prev] | [next] | [standalone]
| From | Clifford Heath <no.spam@please.net> |
|---|---|
| Date | 2019-06-02 17:42 +1000 |
| Message-ID | <O5LIE.7127$c55.892@fx35.iad> |
| In reply to | #545412 |
On 2/6/19 12:19 am, Rodney Pont wrote: > On Sat, 1 Jun 2019 21:06:36 +1000, Clifford Heath wrote: > >> The Arduino C libraries are a really bad direction to start off in, even >> for a raw beginner. They are so unnecessarily so very badly implemented. > > A lot of the C/C++ libraries seem to have been written by people who > are out to prove how clever they are. Some I understood what they were > doing and managed to use them but there were a lot more that just > didn't have sufficiently clear documentation for me to use them. I've > been using 'objects' for nearly thirty years and get along with them > but I found it hard to understand how the developer got from there to > here if you see what I mean. Tend to agree, but what can you expect for nothing? OTOH it can be done well. How do you find this C++ and documentation: <https://github.com/cjheath/AD9959>? Clifford Heath.
[toc] | [prev] | [next] | [standalone]
| From | "John Miles, KE5FX" <jmiles@gmail.com> |
|---|---|
| Date | 2019-06-02 01:53 -0700 |
| Message-ID | <ecf205a6-22d6-435e-b571-5a5fb0a3a0a4@googlegroups.com> |
| In reply to | #545514 |
On Sunday, June 2, 2019 at 12:42:43 AM UTC-7, Clifford Heath wrote: > Tend to agree, but what can you expect for nothing? OTOH it can be done > well. How do you find this C++ and documentation: > <https://github.com/cjheath/AD9959>? That's an amusing coincidence. I spent this afternoon duct-taping an AD9959 demo board to a Mega2560 for a one-off production test rig, when I wasn't on here arguing with (seemingly drunk) people about C. The board refused to put out a signal at first, and having seen your page in the Google results for 'AD9959', I was tempted to crib your register settings from it. It eventually occurred to me to run the ADI software and dump its registers for comparison, but your source code was going to be the next resort if that hadn't worked. Looks good to me, for what that's worth. :) -- john, KE5FX
[toc] | [prev] | [next] | [standalone]
| From | Clifford Heath <no.spam@please.net> |
|---|---|
| Date | 2019-06-02 22:46 +1000 |
| Message-ID | <uyPIE.26250$dK3.25195@fx28.iad> |
| In reply to | #545521 |
On 2/6/19 6:53 pm, John Miles, KE5FX wrote: > On Sunday, June 2, 2019 at 12:42:43 AM UTC-7, Clifford Heath wrote: >> Tend to agree, but what can you expect for nothing? OTOH it can be done >> well. How do you find this C++ and documentation: >> <https://github.com/cjheath/AD9959>? > > That's an amusing coincidence. I spent this afternoon duct-taping > an AD9959 demo board to a Mega2560 for a one-off production test rig, > when I wasn't on here arguing with (seemingly drunk) people about C. > > The board refused to put out a signal at first, and having seen your page > in the Google results for 'AD9959', I was tempted to crib your register > settings from it. It eventually occurred to me to run the ADI software > and dump its registers for comparison, but your source code was going to > be the next resort if that hadn't worked. > > Looks good to me, for what that's worth. :) I've not used it yet, and have a report of endian problems, and perhaps others. Please report issues if you find them :). But I'm proud of the documentation and testing structure (it took several days studying the data sheet to design!), and will hopefully get to test it myself soon. Clifford Heath
[toc] | [prev] | [next] | [standalone]
| From | Dennis <dennis@none.none> |
|---|---|
| Date | 2019-06-01 09:43 -0500 |
| Message-ID | <qcu2tu$6cd$1@dont-email.me> |
| In reply to | #545397 |
On 6/1/19 6:06 AM, Clifford Heath wrote: > On 1/6/19 4:50 pm, Tom Gardner wrote: >> What you gain on the swings you lose on the roundabouts. >> >> While I am certainly no fan of C++ (e.g. see the C++ FQA), >> one advantage of the Arduino class machines is that you are >> programming against bare silicon. > > If you think that 120 CPU cycles to set or clear a port pin is "bare > silicon" then I don't know what to think. That's how long "digitalWrite" > takes to perform a 2-cycle operation. That is because digitalWrite() allows you to dynamically assign the pin at run time. If you have a fixed pin you want to use and speed is important, you can use builtin assembler operations (DDRx,PORTx,PINx) to get your two cycle operation. Most beginner projects are more human speed so 2 or 200 cycles doesn't make much difference. > > The Arduino C libraries are a really bad direction to start off in, even > for a raw beginner. They are so unnecessarily so very badly implemented. Yes some of them are awful, but the more common ones are good and getting better. For the beginner it lets them easily get something working even if the dark corners have dragons. Besides it can be a learning experience going through the library code to see what is screwed up :-) (not for the beginner or faint of heart!). > >> Having an operating system in a hard real-time system can >> be a real impediment and a steep learning curve. >
[toc] | [prev] | [next] | [standalone]
| From | Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> |
|---|---|
| Date | 2019-06-01 11:30 -0400 |
| Message-ID | <862dnR7vW66xB2_BnZ2dnUU7-a-dnZ2d@supernews.com> |
| In reply to | #545414 |
On 6/1/19 10:43 AM, Dennis wrote: > On 6/1/19 6:06 AM, Clifford Heath wrote: >> On 1/6/19 4:50 pm, Tom Gardner wrote: >>> What you gain on the swings you lose on the roundabouts. >>> >>> While I am certainly no fan of C++ (e.g. see the C++ FQA), >>> one advantage of the Arduino class machines is that you are >>> programming against bare silicon. >> >> If you think that 120 CPU cycles to set or clear a port pin is "bare >> silicon" then I don't know what to think. That's how long >> "digitalWrite" takes to perform a 2-cycle operation. > > That is because digitalWrite() allows you to dynamically assign the pin > at run time. If you have a fixed pin you want to use and speed is > important, you can use builtin assembler operations (DDRx,PORTx,PINx) to > get your two cycle operation. Most beginner projects are more human > speed so 2 or 200 cycles doesn't make much difference. > >> >> The Arduino C libraries are a really bad direction to start off in, >> even for a raw beginner. They are so unnecessarily so very badly >> implemented. > > Yes some of them are awful, but the more common ones are good and > getting better. For the beginner it lets them easily get something > working even if the dark corners have dragons. > > Besides it can be a learning experience going through the library code > to see what is screwed up :-) (not for the beginner or faint of heart!). Not a bad method. I taught myself circuit design largely by reading app notes, assuming that all the circuits were junk, and figuring out why. (Some of them are okay, of course, but you can always think about input protection and so forth.) Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-06-03 00:00 -0400 |
| Message-ID | <ZX0JE.34913$jA4.29688@fx07.iad> |
| In reply to | #545421 |
On 6/1/19 11:30 AM, Phil Hobbs wrote: > On 6/1/19 10:43 AM, Dennis wrote: >> On 6/1/19 6:06 AM, Clifford Heath wrote: >>> On 1/6/19 4:50 pm, Tom Gardner wrote: >>>> What you gain on the swings you lose on the roundabouts. >>>> >>>> While I am certainly no fan of C++ (e.g. see the C++ FQA), >>>> one advantage of the Arduino class machines is that you are >>>> programming against bare silicon. >>> >>> If you think that 120 CPU cycles to set or clear a port pin is "bare >>> silicon" then I don't know what to think. That's how long >>> "digitalWrite" takes to perform a 2-cycle operation. >> >> That is because digitalWrite() allows you to dynamically assign the >> pin at run time. If you have a fixed pin you want to use and speed is >> important, you can use builtin assembler operations (DDRx,PORTx,PINx) >> to get your two cycle operation. Most beginner projects are more human >> speed so 2 or 200 cycles doesn't make much difference. >> >>> >>> The Arduino C libraries are a really bad direction to start off in, >>> even for a raw beginner. They are so unnecessarily so very badly >>> implemented. >> >> Yes some of them are awful, but the more common ones are good and >> getting better. For the beginner it lets them easily get something >> working even if the dark corners have dragons. >> >> Besides it can be a learning experience going through the library code >> to see what is screwed up :-) (not for the beginner or faint of heart!). > > Not a bad method. > > I taught myself circuit design largely by reading app notes, assuming > that all the circuits were junk, and figuring out why. (Some of them > are okay, of course, but you can always think about input protection and > so forth.) > > Cheers > > Phil Hobbs > The only thing scarier than hardware engineers designing software is software engineers designing hardware. Leave designing hardware to physicists. Then the hardware engineers will be free to write software and the software engineers can do the physics.
[toc] | [prev] | [next] | [standalone]
| From | Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> |
|---|---|
| Date | 2019-06-03 05:52 +0000 |
| Message-ID | <qd2cj0$64d$1@dont-email.me> |
| In reply to | #545678 |
On a sunny day (Mon, 3 Jun 2019 00:00:56 -0400) it happened bitrex <user@example.net> wrote in <ZX0JE.34913$jA4.29688@fx07.iad>: >The only thing scarier than hardware engineers designing software is >software engineers designing hardware. Leave designing hardware to >physicists. Then the hardware engineers will be free to write software >and the software engineers can do the physics. Although I agree with many other things you tweeted here, the problem these days, and has perhaps always been, is draw lines between fields. I hove worked in many different fields from high power to physics to medical to broadcast to repair to hardware design software design, documentation writing, so much more translation, always curious about the next field. Applying what you learned in one field to the other is where the real strength is, invention. We need more of that, Not the limited responsibility closed horizons do what the boss says servitude that for example did lead to that recent Boeing disaster. There ARE no separation lines, those only exist in illusion.
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-06-03 11:33 -0400 |
| Message-ID | <l5bJE.48980$KA4.25006@fx05.iad> |
| In reply to | #545684 |
On 6/3/19 1:52 AM, Jan Panteltje wrote: > On a sunny day (Mon, 3 Jun 2019 00:00:56 -0400) it happened bitrex > <user@example.net> wrote in <ZX0JE.34913$jA4.29688@fx07.iad>: > >> The only thing scarier than hardware engineers designing software is >> software engineers designing hardware. Leave designing hardware to >> physicists. Then the hardware engineers will be free to write software >> and the software engineers can do the physics. > > Although I agree with many other things you tweeted here, > the problem these days, and has perhaps always been, is draw lines between fields. > I hove worked in many different fields from high power to physics to medical to broadcast to > repair to hardware design software design, documentation writing, so much more > translation, always curious about the next field. > Applying what you learned in one field to the other is where the real strength is, invention. > We need more of that, > Not the limited responsibility closed horizons do what the boss says servitude that for example > did lead to that recent Boeing disaster. > > There ARE no separation lines, those only exist in illusion. > I think it's okay to just "do what the boss" says in many circumstances. It's (ideally) why there are managers, after all. they manage. It's a job that needs doing. The problem becomes when for whatever reason nobody feels confident enough to, from time to time, tell the boss that their idea is dumb without fear of negative repercussions. That fear is often ingrained in very rigid hierarchical structures like the way a "legacy company" like Boeing might be organized. It's something you see. Design decisions where you think "so this probably passed through a number of review stages and the fact that this dumb thing is sitting in front of me, making my life miserable, is because EVERYONE down that chain signed off on it. Really? but me and everyone else I've asked has opined 'this is dumb.' Why at no point did anyone in that chain speak up and also say HEY. THIS IS A DUMB IDEA and point out the emperor has no clothes? Surely someone must have noticed?"
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-06-03 11:41 -0400 |
| Message-ID | <kcbJE.17524$w55.11490@fx44.iad> |
| In reply to | #545720 |
On 6/3/19 11:33 AM, bitrex wrote: > On 6/3/19 1:52 AM, Jan Panteltje wrote: >> On a sunny day (Mon, 3 Jun 2019 00:00:56 -0400) it happened bitrex >> <user@example.net> wrote in <ZX0JE.34913$jA4.29688@fx07.iad>: >> >>> The only thing scarier than hardware engineers designing software is >>> software engineers designing hardware. Leave designing hardware to >>> physicists. Then the hardware engineers will be free to write software >>> and the software engineers can do the physics. >> >> Although I agree with many other things you tweeted here, >> the problem these days, and has perhaps always been, is draw lines >> between fields. >> I hove worked in many different fields from high power to physics to >> medical to broadcast to >> repair to hardware design software design, documentation writing, so >> much more >> translation, always curious about the next field. >> Applying what you learned in one field to the other is where the real >> strength is, invention. >> We need more of that, >> Not the limited responsibility closed horizons do what the boss says >> servitude that for example >> did lead to that recent Boeing disaster. >> There ARE no separation lines, those only exist in illusion. >> > > I think it's okay to just "do what the boss" says in many circumstances. > It's (ideally) why there are managers, after all. they manage. It's a > job that needs doing. > > The problem becomes when for whatever reason nobody feels confident > enough to, from time to time, tell the boss that their idea is dumb > without fear of negative repercussions. That fear is often ingrained in > very rigid hierarchical structures like the way a "legacy company" like > Boeing might be organized. > > It's something you see. Design decisions where you think "so this > probably passed through a number of review stages and the fact that this > dumb thing is sitting in front of me, making my life miserable, is > because EVERYONE down that chain signed off on it. Really? but me and > everyone else I've asked has opined 'this is dumb.' Why at no point did > anyone in that chain speak up and also say HEY. THIS IS A DUMB IDEA and > point out the emperor has no clothes? Surely someone must have noticed?" It's part of why this ng is valuable to me even though it contains, to my mind, a bunch of assholes who have bad political opinions. I can use it to get my own bad engineering ideas broken. Great! Bad engineering ideas at least should be broken at the outset. Saves time that way. Lots of people here happy to do it!
[toc] | [prev] | [next] | [standalone]
| From | pcdhobbs@gmail.com |
|---|---|
| Date | 2019-06-03 16:29 -0700 |
| Message-ID | <e6b7d946-1e00-4888-b7c0-6d459421cc15@googlegroups.com> |
| In reply to | #545721 |
>It's part of why this ng is valuable to me even though it contains, to >my mind, a bunch of assholes who have bad political opinions. We knew that you weren't here for the usual reasons, for instance to be friendly or helpful. Cheers Phil Hobbs
[toc] | [prev] | [next] | [standalone]
Page 3 of 6 — ← Prev page 1 2 [3] 4 5 6 Next page →
Back to top | Article view | sci.electronics.design
csiph-web