Processor choice

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View

I had to have my septic tank pumped this week.  The guy had this nifty
little flushable transmitter that he flushed down a toilet that emits
a signal that can be detected with a metal detector-like receiver
through up to 10 ft of earth.  The only problem is the scummy vendor
programs it to quit working after 6 hours and they cost about $40.

When he saw my lab and I told him what I do, he asked me if I could
design him a unit which would not time out.  Of course I said "sure".
And I'm going to make it inductively charged.

I took a quick look with a scope.  It emits a string of 13 sine waves
twice a second, separated by a second of quiet time.  The owner's
manual says 225kHz but I think that's a mis-print.  It looked
something more around 22kHz.  I don't think 225kHz would penetrate 10
feet of dirt.

So now to my question.  I want to use a little 8 pin processor to
drive my unit just like theirs uses. But I do NOT want to learn yet
another assembly language.  Is there an 8 pin processor which can be
programmed in C?

I'm willing to squeeze in a processor with more pins before I'll
program in assembly language.

Thanks,
John

Re: Processor choice
On 2/26/21 9:12 AM, neonjohn wrote:
Quoted text here. Click to load it

Seems like a typical typo, missing decimal point, to me. "22.5 kHz" is  
"around 22 kHz".



--  
Grant. . . .
unix || die

Re: Processor choice
On Friday, 26 February 2021 at 17:18:41 UTC, Grant Taylor wrote:
Quoted text here. Click to load it

The ATtiny214 is an 8-pin device with an 8-bit DAC and can be programmed in C.
There are some even smaller ATtinys without DAC which can also be programmed in C.
John

Re: Processor choice
On Fri, 26 Feb 2021 09:38:31 -0800 (PST), John Walliker

Quoted text here. Click to load it

Thanks.  I already have Studio installed but I have to run it in a
friggin winders VM.  I don't know whether I'll need an ADC or not
until I reverse engineer this thing.  Probably not.

Thanks,
John

Re: Processor choice
On a sunny day (Fri, 26 Feb 2021 11:12:01 -0500) it happened neonjohn

Quoted text here. Click to load it

It is not the answer you want, but really asm has a lot of advantages
both in developnent speed and efficieny of use of the hardware.
I have programmed many micros and also 8086 stuff in asm.
basically it is all the same
C and C++ is a pest on very small micros creating not-needed overhead.

For a few sine waves all you need is a lookup table and DAC or R2R DAC.
Simplest PIC has the DAC and the code space.
 http://panteltje.com/panteltje/pic/index.html
  for some PIC asm.




  

Re: Processor choice
On 26/02/21 16:12, neonjohn wrote:
Quoted text here. Click to load it

The ATTiny85 are used in the Arduino ecosystem.

Re: Processor choice
Maybe the commercial one can be hacked to not turn off?

Re: Processor choice
On Fri, 26 Feb 2021 12:59:12 -0500, Bob Engelhardt

Quoted text here. Click to load it

Unfortunately, no.  It uses an 8 pin micro with the numbers ground
off.  It is programmed to permanently turn off after 6 hours.

John

Re: Processor choice
On 26/02/2021 17:12, neonjohn wrote:
Quoted text here. Click to load it

Why 8 pin?  If you have size requirements give them.  If you have
requirements for price, give them.  Are you making 1 of these, 10 of
them, ten thousand of them?

And are you writing the program this century, or last century?  Because
"programmable only in assembly" has not been a feature of any
microcontroller for a couple of decades.  (Though it is fair to say that
there are still some microcontrollers sold that are not very C friendly.)

Re: Processor choice
On Fri, 26 Feb 2021 19:00:47 +0100, David Brown

Quoted text here. Click to load it

Just don't use parameters and local (automatic) variables and a decent
C-compiiler will generate acceptable  code even on C-unfriendly
controller :-).

These days C-compilers are in general so good that you can use it for
general programming  However, assembler is needed  in order to utilize
special hardware instructions that can't be expressed in C. One such
example is multiple byte data manipulation such as long/floating point
add/sub/mul/div which requires handling directly the Carry (and
possibly overflow or half carry) bits, which can't be handled directly
in C.


Re: Processor choice
On 2/26/2021 2:08 PM, snipped-for-privacy@downunder.com wrote:
Quoted text here. Click to load it

And avoid anything that draws on libraries over which you may have no control.

Quoted text here. Click to load it

Sometimes, "helper routines" are automatically invoked to address these
"more cumbersome" operators and data types.  But, my above warning
applies equally.

Often, esp when dealing with the hardware, it's easier to learn just enough
of the applicable ASM to ensure the exact sequence of opcodes are executed
that you need -- instead of hoping the compiler doesn't reorder instructions
or that you forget a keyword, etc.

[Sorting out how the hardware actually works often takes longer than
writing the ASM to drive it as you want; you're typically not "doing much"
in the code, at that point]


Re: Processor choice
On Fri, 26 Feb 2021 15:21:04 -0700, Don Y

Quoted text here. Click to load it


Size requirement.  This thing has to be small enough to easily flush
down a toilet and not get stuck in bends or internal protuberances.
Price isn't a real consideration.  I'll probably make this guy 100 of
them but I expect to commercialize it, as this pipe locator is the
standard of the industry.

Quoted text here. Click to load it

The Atmel product catalog disagrees.  


Quoted text here. Click to load it

The Gnu C compiler allows one to insert assembler mnemonics in the
code.  I absolutely will not be using this feature.  All this
controller has to do is turn the oscillator on and off in a certain
pattern.  

John

Re: Processor choice
On 27/02/2021 17:30, neonjohn wrote:
Quoted text here. Click to load it

Right.  So "8 pin" has nothing to do with it.  In fact, the size of the
microcontroller isn't directly a requirement either - it is the size of
the complete system that matters.  You could have a big microcontroller
that can generate the sine waves directly, as an alternative to a small
microcontroller and external oscillator.  Quite possibly the battery
will be the biggest part.

Quoted text here. Click to load it

Disagrees with what?

Quoted text here. Click to load it


Re: Processor choice
On 2/27/2021 9:30 AM, neonjohn wrote:
Quoted text here. Click to load it

Patent infringement?

Quoted text here. Click to load it

Then you'll have to ensure any device chosen has all of its I/O memory-mapped
and the compiler supports direct access to "special registers".

Quoted text here. Click to load it

It's "enough" to just generate square waves (no need for fancier DDS)?

Presumably, the "detector" isn't actually looking for a "signature"
(specific sequence of frequencies of specific durations) but, rather,
the different frequencies help in detecting the signal through "earth"?

One advantage to abandoning a HLL is you could probably make use of
the 1c MCUs available (I don't think they currently have compiler
support).  No idea what the desired price point is (though suspect
"plumbers" aren't expected to be price sensitive for a job like that)
so no idea how many pennies you need to shave...

Re: Processor choice
On 27/02/2021 19:35, Don Y wrote:
Quoted text here. Click to load it


Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

That's an important point.

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Do you have any examples of microcontrollers that /don't/ have virtually
all their IO as memory mapped registers, and /don't/ have toolchains
supplied with headers and/or intrinsics for accessing any additional
important "special registers" ?

Quoted text here. Click to load it

Quoted text here. Click to load it

There are no 1c microcontrollers available.  10c, possibly, as bare dies
with minimum order quantities in the millions.  (If you have references
to contradict this, please give them.)

But if this is going to be a real product, there are a large number of
far more economically relevant factors involved - certification as a
radio transmitting devices, making packaging that will survive the
septic tank environment, environmental concerns (like losing it into
nature somewhere), safety certifications (testing and certifying that it
won't explode sewer gas pockets), patents (as you mentioned), and so on.
 I'd give a wild guess and say that as long as the microcontroller is
under $10, it's just a rounding error in the real cost.


Re: Processor choice
On 28/02/21 11:47, David Brown wrote:
Quoted text here. Click to load it

3.3 cent OK? Padauk PMS150C (PFS154C flash 11 cent)

https://www.cnx-software.com/2019/08/14/padauk-pms150c-3-cents-mcu-supports-sdcc-open-source-toolchain/
https://www.eevblog.com/forum/blog/eevblog-1144-padauk-programmer-reverse-engineering/
https://blog.adafruit.com/2019/10/09/a-led-candle-based-on-the-3-cent-mcu-microcontrollers/

Whether you would want to use them, especially in this application,
is left as an exercise for the student :)

I strongly suspect the non-technical factors will be the tail that
wags the dog, especially any form of commercial infringement.

Re: Processor choice
On 28/02/2021 13:04, Tom Gardner wrote:
Quoted text here. Click to load it


Quoted text here. Click to load it

I stand corrected!  I'll have a little look at these.

Quoted text here. Click to load it

I think even technical factors (like a suitable casing) will be far more
important than the microcontroller, but I agree that the non-technical
factors may be even more so.

I've seen a lot of people with bright ideas and working prototypes get
shocked when they find the actual cost of producing their device is 10
or more times what they estimated, and the one-time costs (development,
testing, certification, etc.) have several more digits than they thought.

Re: Processor choice
On 28/02/21 13:26, David Brown wrote:
Quoted text here. Click to load it


Quoted text here. Click to load it

I suspect their prime claim to fame will be that they
enabled programmers to say that there's no valid use case
for 555s :(


Quoted text here. Click to load it

A crap case matches a 6 hour lifetime :)


Quoted text here. Click to load it

Oh, yes indeed.

When I was in contract R&D, after the initial client
meeting we often didn't work up a full proposal, but
told the client "in our experience this class of project

didn't have to do a full proposal :)


Re: Processor choice
On 2/28/2021 5:47 AM, David Brown wrote:
Quoted text here. Click to load it


Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

There are 3c ones available.  
<
https://www.youtube.com/watch?v=4fvFLSeDc4M&t10%47s


Quoted text here. Click to load it



Re: Processor choice
wrote:

Quoted text here. Click to load it

Is that all?  If so, why not ditch the microcontroller and use a
handfull of 555 timer chips to implement the oscillator modulation?

I built such a circuit many years ago, using one 555 to create and
audio tone, and the other 555 to FM modulate the audio tone by a
frequency ratio of four with a period of a few seconds.

Joe Gwinn

Site Timeline