[chbot] Programming 8-bit microcontrollers

Charles Manning cdhmanning at gmail.com
Fri Sep 23 09:12:00 BST 2016


The correct answer... Just bypass all these hassles and do yourself a
favour . Forget about 8-bit micros.

Switch to Cortex M0s. They're generally cheaper than 8-bitters these days
and do pretty much everything better.



On Fri, Sep 23, 2016 at 7:35 PM, Mike Field <hamster at snap.net.nz> wrote:

> Is 'defaults' an array, and what type? Or is that some ANSI C++ 2022
> encapsulated abstracted virtualised templated STL thingy?
>
> Should not it be "static const u32_t defaults[] = {..."?
>
>
> -------- Original Message --------
> Subject: Re: [chbot] Programming 8-bit microcontrollers
> From: Mark Atherton
> To: chchrobotics at lists.linuxnut.co.nz
> CC:
>
>
> would have defines 1000 as 1000L, so similar to synco, maybe cast
> setting to u32, the multiplied by 1000L
>
> the layout of the class looks suspicious 3 x u8, 1 x u32, 1 x u8, 1 x
> u16 - would have tried to lay out on u32 boundaries : 1 x u32, 4 x u8, 1
> x u16
>
> I can smell that Volker has set up some traps, so am looking for signed
> / unsigned mixes, and extensions, but I see none ...
>
> shouldn't this trap be awarded 'un poisson de chocolat'
>
> -mark
>
>
>
> On 23/09/2016 5:38 PM, Synco Reynders wrote:
> > To get a nice value for 'setting' you should cast to be 32 bit before
> multiplying. Like:
> > ms = (uint32_t) setting *1000
> >
> >
> > On 23 September 2016 at 15:34, Volker Kuhlmann
> wrote:
> >
> > This is for AVR, but should hold for any 8-bit job. Spot the
> problems:
> >
> > static const uint16_t setting = 15*60;
> > class values {
> > uint8_t a, b, c;
> > uint32_t d;
> > uint8_t e;
> > uint16_t f;
> > };
> > static const values defaults {
> > 50, 1, 10, 0xFFB070, 5, 0x03FF
> > };
> > void func() {
> > unsigned long ms;
> > ms = setting * 1000;
> > ...
> > }
> >
> > The program doesn't work in 2 places.
> >
> > First solution wins a free copy of the night light firmware.
> >
> > First correct solution wins 2 free copies of the night light
> firmware.
> >
> > Prize giving on Monday...
> >
> > Volker
> >
> > --
> > Volker Kuhlmann
> > http://volker.top.geek.nz/ Please do not CC list postings to me.
> >
> > _______________________________________________
> > Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> > http://lists.ourshack.com/mailman/listinfo/chchrobotics
> > Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> > Meetings usually 3rd Monday each month. See http://kiwibots.org
> for venue, directions and dates.
> > When replying, please edit your Subject line to reflect new
> subjects.
> >
> >
> >
> >
> > _______________________________________________
> > Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> > http://lists.ourshack.com/mailman/listinfo/chchrobotics
> > Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> > Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> > When replying, please edit your Subject line to reflect new subjects.
>
>
>
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
>
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20160923/d4e4c603/attachment.html>


More information about the Chchrobotics mailing list