[MakeLV] My dream project

Darrell Thayer darrell.thayer at gmail.com
Thu Jul 12 23:09:09 CDT 2012


These days, a digital storage scope is a required minimum - especially for
looking at non-repetitive things like communications signals (UART, IR LED,
SPI, I2C...) or any "special events". I use an OWON PDS5022S two channel
scope at home (at about $300); its LCD screen not so great, but it has
helped me see signals that could simply not be see otherwise (like IR data
pulses/codes). The Rigol scopes look better and don't cost much more.

But really, for digital signals, a logic analyzer is (also) needed. Too
often one tries to use an O'scope where a logic analyzer is a much better
tool. I use an inexpensive Zeroplus LAP-C USB logic analyzer at work; they
come in many price ranges (based on number of channels & max sample
rate). The Zeroplus analyzers (and other brands) also include "protocol
decoding" - so that you can see your UART, SPI, I2C data in
hex/decimal/ASCII; but other protocol decoding can cost extra. Even "packet
demarcation" is included (as it is best to send/receive data in packets).
Protocol decoding is priceless! The cheapest Zeroplus LAP-C is only $115
(16 channel, 32K memory, 100Mhz sample rate). The cool thing about these
new USB logic analyzers is that they can use "live data compression" -
which makes it seem like they have way more memory than logic analyzers of
yesteryear (even $25,000 ones!). The Zeroplus software has worked very well
for me (even running fine on Windows 7 64 Bit).

Another brand of USB scope/analyzer is* *Bitscope (I have not used one) -
and there are many others.
I have also used the Vellman USB O'scopes - but they seem a bit too cheaply
made (crashing software, poor triggering, super cheap scope leads...).

I am assuming that most signals to be observed are not RF (radio frequency)
- scopes for RF can start in the thousands of dollars.

Once upon a time, one did need faster scopes to do design
with micro-controllers (looking at chip-selects, data/address bus signals
for proper "setup and hold" times). However, today
most micro-controllers/designs do not need to use external (parallel) buses
... because you can buy a device with all the RAM, FLASH, and I/O devices
you need. If external devices are needed, you talk to them over I2C, SPI,
or UARTs instead. SPI and I2C serial interfaces are often even "bit banged"
just fine w/o special hardware support (and easier to troubleshoot that way
anyway.

And... on the topic of "scopes", if the Hive does not have one yet, a
stereo "inspection" microscope is a must ... for general
inspection/analysis of anything, soldering (surface mount soldering is
almost hopeless w/o one), and even just trying to repair your average
phone/pod/touch/pad USB cable - or even your average modern ear-bud cables.
Something like this: AmScope 3.5X-90X Binocular Stereo Zoom Microscope on
Boom + 80 LED (ring) Light is only $400 at Amazon; these "long working
distance" microscopes are needed so you have room to get a soldering
iron/sucker between the objective lens and a circuit board. They are
also awesome at removing splinters from feet and hands (just ask my kids).

Finally, if you are going to write good (non spaghetti logic) embedded code
that does more than one thing at a time, learn to use Finite State Machines
(FSMs - not Flying Spaghetti Monsters). All digital design (FPGA, CPLD)
simply has to use them. All AI (Artificial Intelligence) software uses them
(mostly for video games). An ROTS (Real-Time Operating System) is one way
to do many things at once, but WOW, an RTOS can get massively complicated
really fast (and run very poorly - if at all - on tiny micro-controllers).
The UML can be used for FSM design - but using UML is like using a
supercomputer to do your algebra homework. Refer to THE paper that coined
the term "statecharts" - David Harel's paper (
http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf).
David Harel revolutionized the (practical) use of FSMs in software ... the
the UML adopted Statecharts and made them impractical again!  Original
"Harel type" FSMs are very easy to design (right on good old paper or
whiteboards) and then "code up" in C; your tiny little processor really can
do 15 very complex things 20 times a second ... like magic!

Darrell


On Thu, Jul 12, 2012 at 1:05 PM, Will <staticphantom at gmail.com> wrote:

> Well aware Darrell, the problem with the pickit 3 that the support in
> linux is minimal (you would think that MPLab X would have better support
> but doesn't). I've used the ICD 2's and 3's when I was at school working at
> the Space Systems and Controls Lab at Iowa State and I have to say, I loved
> the ICD programmers but I have never run across a need for them as a
> hobbyist yet.
>
> Which oscilloscopes would you recommend for the space? I'm looking at some
> USB oscilloscopes but I haven't decided yet. Do you have any
> recommendations? I'm partial to LeCroy but without the budget of my former
> employer I don't think it's an option :(. Especially since I love using and
> abusing the Xstream browser for automated testing. I think for the space
> I'm torn between a USB scope because digital acquisition is nice and would
> be great for documentation, or just something handy that is portable in the
> space.
>
> -Will C
>
>
> On Thu, Jul 12, 2012 at 12:10 PM, Darrell Thayer <darrell.thayer at gmail.com
> > wrote:
>
>> It is true that the "cost of entry" to writing C code on PICs was once
>> kind of high - because the C compilers were NOT free. However, today ALL
>> the "lite/student" versions of PIC C compilers are totally free. What is
>> not free is the ability to enable the compiler optimizations that can make
>> your code faster and/or smaller (FLASH memory use). However, the very low
>> cost of PIC processors means that you can simply use a somewhat more
>> powerful processor (for like $1 more) and still get the performance and/or
>> RAM/FLASH needed - all WITHOUT optimizations. Also, note that compiler
>> optimizations can OFTEN cause nasty little bugs that are very difficult to
>> find - so it is common for industries like medical and aerospace to simply
>> NOT use optimizations at all anyway.
>>
>> So, for the one time $45 cost of a Microchip debugger (PICKIT3), you can
>> have the same full blown development environment that serious industry uses.
>> If you fork out the cash for the ICD3 debugger (< $200), Microchip will
>> replace it for free whenever you let out its magic smoke.
>>
>> Today, embedded programming for hobbyists has never been easier or
>> cheaper.
>>
>> But... remember that any embedded processor work will
>> likely occasionally need access to an O'scope (try the cheap $300 Owon's
>> from China).
>>
>> Darrell
>>
>>
>> On Wed, Jul 11, 2012 at 11:30 AM, Will <staticphantom at gmail.com> wrote:
>>
>>> I agree with Darrell too, and anyone who has heard me talk at the space
>>> knows my stance on Arduino's... I really should making fun of them. I'll
>>> admit I'm a biased towards PIC's but the cost of entry is so high that I've
>>> stuck to what limited time I have for embedded to work with AVR's.
>>>
>>> Since the topic came up, does anyone know the pin out for the connect
>>> for the AVR Dragon? I bought programmer that is a knock off (but still had
>>> the ICD like the dragon) and haven't gotten the pin out. I have a board I
>>> want to make a development board but I want the pinout of programmer so I
>>> can solder some headers for programming/debugging.
>>>
>>> -Will
>>>
>>>
>>>
>>> _______________________________________________
>>> Makelehighvalley mailing list
>>> Makelehighvalley at makelehighvalley.com
>>>
>>> http://makelehighvalley.com/mailman/listinfo/makelehighvalley_makelehighvalley.com
>>>
>>>
>>
>> _______________________________________________
>> Makelehighvalley mailing list
>> Makelehighvalley at makelehighvalley.com
>>
>> http://makelehighvalley.com/mailman/listinfo/makelehighvalley_makelehighvalley.com
>>
>>
>
> _______________________________________________
> Makelehighvalley mailing list
> Makelehighvalley at makelehighvalley.com
>
> http://makelehighvalley.com/mailman/listinfo/makelehighvalley_makelehighvalley.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://makelehighvalley.com/pipermail/makelehighvalley_makelehighvalley.com/attachments/20120713/36c7f1e7/attachment.htm>


More information about the MakeLehighValley mailing list