Re: One Second Pulse-Width, Once Per Hour

Texas Instruments... whoops, take that back, they bought SSI.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson
Loading thread data ...

Yeah, but what does the development system cost? I can't just buy a PIC chip and plug it in, now, can I? I have to have _some_ way of getting this hypothetical 5-minute program into the chip, right?

So, what's that going to cost?

Thanks, Rich

Reply to
Rich Grise

The software is free, and you can make your own programmer very easily... see

formatting link
for a simple one.

Of course, a decent programmer will cost more, but that one will do the job.

Al

Reply to
Al Borowski

to

accurate.

Download MPLAB off Microchip, cost = 0 Build a Ludipipo or a JDM, cost (assuming you have no parts) $2 ish ?

Total 2$

Reply to
Mjolinor

--

->On Fri, 02 Apr 2004 23:17:51 GMT, snipped-for-privacy@austininstruments.com (John Fields)

->>>>

->>>>This is just *begging* for a low end PIC :-)

->>>>

->>>>This would take literally 5 mins to code (if that) and be very accurate.

->>>>Only problem is if the OP doesn't have a programmer. If he does, heck,

->>>>I'll even code it.

->>>>

->>>>Al

->>>

->>>yup, pic12c508 eight pin dip internal 4mhz clk, less than a buck each.

->>>But the old timers'll never go for it...

->>

->>---

->>Maybe not, since it might depend on the accuracy of the internal clock

->>oscillator. What is it?

->

->Its an internal 4 MHz RC oscillator with programmable calibration.

->here is the link to the datasheet.

->

->

formatting link

-

----

-Since I'm an "old timer" and I don't have all that much time left to

-go slogging through Microchip's data sheets, I thought that since you

-seem to be familiar with their products perhaps you might be good

-enough to summarize the maximum accuracy attainable???

Not accurate enough. It's 1% typical at room temp, and 10% over the full temp range. And temp is a problem no doubt. I have a PIC based sunrise/sunset light controller for my outside lights that's actually crystal driven with a

32.768 Khz crystal driving timer1 to develop the RTC. The board sits in my unfinished basement and is subject to wider temp variations than the rest of the indoor space. It drifts enough that I have to reset it at least twice a month. So even putting a crystal in is no guarantee that you'll develop a stable time base.

The most stable time base is the power cycle frequency coming out of the wall. Long term it's generally spot on. All it takes is a transformer, a series resistor, and a zener to develop a digital square wave that can be feed directly into an input.

BAJ

Reply to
Byron A Jeff
-

->

-> Yeah, but what does the development system cost? I can't just

-> buy a PIC chip and plug it in, now, can I? I have to have

-> _some_ way of getting this hypothetical 5-minute program into

-> the chip, right?

->

-> So, what's that going to cost?

-

-The software is free, and you can make your own programmer very

-easily... see

formatting link
for a simple one.

Thanks for the plug. It's one of the reasons that I designed it.

-

-Of course, a decent programmer will cost more, but that one will do the job.

Hey! ;-)

BAJ

Reply to
Byron A Jeff

I use a Picstart Plus programmer from Microchip and love it! ordered it from digikey $199.99 does all Microchips products and is eeprom upgradable. Here's the picstart user guide...

formatting link

There's a few free diy kits out there but haven't tried them,why bother if I have the picstart right?

Remove "HeadFromButt", before replying by email.

Reply to
maxfoo

90% of the problems I see with people getting started have to do with 3rd party programmers* that don't really meet the programming specs, don't support many of the chips and so on. If you're a hobbyist and a few hundred $ is a big deal, sure, fool around with them, but if you're a professional, slap that plastic or PO down and get the Microchip development programmer Picstart+ and/or ICD2. Note that even the Picstart+ does not meet specs for production programmers (testing at multiple Vdd levels to assure that there is margin in the programming). But, IME, it always works unless the chip has been fried.

BTW, they've hit the end of the line with the Picstart+ as the EPROM of the original 17C (mumble) is full so they can't accommodate all the new models. They have an upgrade module but newer Picstarts should be FLASH upgradable without opening the case.

  • most of the rest come from not reading the 80-300 page data sheet or the 700-1000 page reference manual about things like setting up the SFRs to get the correct function out of given pins, or gotchas such as the one open-drain pin, the odd input-only pin and the loathsome R-M-W issue on the 12 & 16 series. Then there are the errata. Microchip's peripherals seem to me to have more "issues" in general than, say, Motorola's.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany
-

->> wrote:

->>

->> >Jim Thomps->> >> I can't locate the original post, but there was a request for a way to

->> >> generate a one second pulse-width, occurring once per hour. I

->> >> happened on to a similar circuit in the 74HC4040 data sheet and

->> >> modified it for the required pulse-width.

->> >

->> >This is just *begging* for a low end PIC :-)

->> >

->> >This would take literally 5 mins to code (if that) and be very accurate.

->> >Only problem is if the OP doesn't have a programmer. If he does, heck,

->> >I'll even code it.

->> >

->> >Al

->>

->> yup, pic12c508 eight pin dip internal 4mhz clk, less than a buck each.

->> But the old timers'll never go for it...

->>

->Yeah, but what does the development system cost? I can't just

->buy a PIC chip and plug it in, now, can I? I have to have

->_some_ way of getting this hypothetical 5-minute program into

->the chip, right?

->

->So, what's that going to cost?

->

->Thanks,

->Rich

->

-

-I use a Picstart Plus programmer from Microchip and love it!

-ordered it from digikey $199.99 does all Microchips products and is eeprom

-upgradable. Here's the picstart user guide...

-

formatting link

-

-There's a few free diy kits out there but haven't tried them,why bother if I

-have the picstart right?

Yes. But if you don't have a PS+ then you must take a careful look around before comitting to it as it's anywhere from 2 to 20 times the price of other offerings.

For the absolute hobbyist low end, I recommend my own Trivial PIC programmers:

htp://

formatting link

You can get rolling in less than an hour, and probably can build it with junkbox parts.

I think the best middle ground is Wouter van Ooijen's WISP628. A serial based ICSP programmer with free firmware and cross platform programming software. You can build one yourself, or buy one from Wouter (as a programmed chip, kit, or completely assembled)

formatting link

Finally the new crop of In Circuit Debugging (ICD) tools coming out represent a better value than a plain PS+.

Just some thoughts.

BAJ

Reply to
Byron A Jeff
[snip]
[snip]

For this "old-timer" ANALOG dog who specializes in learning new tricks to the point of becoming the expert many times... what do I need to buy to learn uP's? And what is best, Microchip, Atmel,...?

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

--- Basically, I think that what you have to buy is a different mindset from what you need in order to do analog. For an extremely simolistic example, in analog, when you generate a delay you concern yourself with, say, what sizes of R and C you'll need, while if you do it with a µC you become concerned with counting events with known periods and accumulating those counts until a certain number of them happen, whereupon the action you wanted to perform after the delay is allowed to start. with the analog stuff you'll also need to concern yourself with the tolerances of the R and the C, their tempcos, the accuracy of the detecting mechanism, the variations of the power supply, and on and on. Digitally, you basically only have to concern yourself with the accuracy of the clock, and then you only have to consider it once, not every time you turn around and have to spec a different R or C or L for the different things you want to do. That's really too all-encompassing to be true in every case, but it'll give you an idea of how simple and reliable it can make things be.

I like Motorola.

-- John Fields

Reply to
John Fields

Nothing, just download MPLAB from

formatting link
and that's all you need until you want to prove to yourself that the output bits are actually flashing LEDs then you need to build a programmer and blow some. Start with PICS not Atmels (personal opinion which will probably start off some "you don't know what your talking about" type replies).

Reply to
Mjolinor

Thanks! And GOOD, I like to see multiple viewpoints.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

--

-[snip]

->->> yup, pic12c508 eight pin dip internal 4mhz clk, less than a buck each.

->->> But the old timers'll never go for it...

->->>

->->Yeah, but what does the development system cost? I can't just

->->buy a PIC chip and plug it in, now, can I? I have to have

->->_some_ way of getting this hypothetical 5-minute program into

->->the chip, right?

->->

-[snip]

-

-For this "old-timer" ANALOG dog who specializes in learning new tricks

-to the point of becoming the expert many times... what do I need to

-buy to learn uP's? And what is best, Microchip, Atmel,...?

Jim,

As a professional analog engineer, that's almost an unfair question as you've probably forgotten more about circuit design than we'll ever learn. The mechanics are not too difficult. Wouter van Ooijen has a pretty good overview for the PIC (that applies to other uC families as well) here:

formatting link

So I'd rather spend a minute talking about how uC may fit into your current point of view. As an ASIC designer, you already have the process, and probably the rationale down: design and simulate in software, then compile design and download into hardware. the uC process is simular, except that the hardware functionality is predefined. You may actually find this to e a frustrating step backwards from what you are used to. If your ASIC design required an extra UART for example, you could just add one, presuming that you had enough gates to support it and its interconnections to the other components on your ASIC. Well with uC, you'd be stuck with a single UART and would have to implement a software or additional hardware workaround to solve the problem.

The advantage I see is that because the hardware, interconnections, and specifications are pretty much fixed, there is less to worry about in terms of getting going. You know the timers work (and how they work), along with PWM, ADC, USART and the like. So you end up getting a prepackaged set of macro components, with a language ability to define their behavior on a application/application basis.

As for which is best: there is no best, just a wide range of reasons which are tradeoffs: cost, availablity, support. The list goes on and on.

I'll speak for PICs because that's all I use now. Here are some of my general guidelines:

1) I find that bootloaders simplify both the development and the firmware upgrade tasks. I always choose chips that are bootloadale now.

2) Nanowatt technology gives you a wide range of options in terms of speed and power consumption control.

3) PIC assembly is the linguq franca language that developers use to discuss programs. While eventually you'll want to get to higher level languages, it's worth the investment to learn how to program in PIC assembly, simply so that you'll be aware of how things get done.

4) I always choose the develop on the fullest featured chip using all of the available tools. Then if for whatever reason if you need to go to a production form, you can downgrade the chip to the one that meets the coverage of the tools that you've choosen. So in terms of features, package size, and nanowatt, this is my current stable: 12F675, 16F88, 16F876A/877A, 18F1330*,

18F4330* (*: I'm still working on development tools for the 18F family).

5) Personally because of bootloaders I find programmers to be pretty irrelevant. The only exception is using ICD. Peter Anderson resells the Olimex ICD package at

formatting link
It's a load cheaper than the Microchip offering.

6) A hard concept to get across to novices, but something that you should have to problem with: Use software to initialize, monitor, and control hardware whenever possible instead of simulating hardware behaviors in software. Bitbanged UARTs, virtual timers, software PWM are examples of the latter. Use real hardware if you have it.

So that's some thoughts. Post any questions here so we can keep a running thread.

BAJ

Reply to
Byron A Jeff

I just got a free Atmel AVR ISP (in system programmer) valued at $50 from circuitcellar.com along with 2ea ATTINY26 chip just for filling out their contest forms. Awesome, eh!...now I've got to learn another assemble language. :(

Remove "HeadFromButt", before replying by email.

Reply to
maxfoo

Since you're used to living with simulations, that will probably work fine.

Here is the link for MPLAB6.5 (Windows assembly development environment). There was a corrupt file on there late last week, but Donna M. at Microchip says it was supposed to have been fixed by Friday afternoon.

formatting link

If you go with your local supplier, I see two distinct paths- starting with something minimal like the PIC12F675 (DIP-8) minimizes the volume of documentation you need to absorb to get to first base. Whereas for small one-off projects, you're probably better off buying a lot more micro and avoiding having to shoe-horn things into a smaller micro. Something like a PIC18F2320 (DIP-28). The latter has 16-bit instructions, the former 14-bit. Maybe first one, then the other? Those of us who have been doing this stuff since the mid-eighties probably tend to underestimate the total amount of stuff that has to be learned.

Some things about the 14-bit architecture (bank switching and interrupt handling, and the read-modify-write issue*) are irritating, and getting RAM banks wrong in assembly is a major source of beginner problems. It's just a matter of care and logical thinking, though, so maybe it won't be an issue for you. The 18F architecture is cleaner, and assembly language programming is more pleasant. You can get C compilers for various 8-bit micros, some are good, some are free, some are unlimited. None are all 3, IMHO, although some people are starting to make positive noises about some gcc ports. If you don't know C already, it probably just adds another level of complexity that isn't needed.

PIC processor Data sheet pages Reference manual pages

------------- ---------------- ----------------------

12F675 132 688 18F2320 372 976

As far as which processor is best, I don't think among 8-bit processors there is a lot of difference for onesey-twosey underutilized applications. I use the 8051 and it's little extinct brother the 8048, I've written tons of code for the 68HC705/908 and the 65C02, and I've used the Atmel AVR. The Motorola peripherals and architecture (especially the 08 series) are nice, as is the AVR. The

8051 is an Intel dog's breakfast, but IMHO very nice for assembly programming. The 65C02 is probably the nicest CPU I've worked with, but it's not very commonly available. A cut-down version is in a lot of low-end consumer goods. The PIC is easily available and there is a lot of code out there on the net, some of which, after careful checking end debugging, could conceivably form the basis for reliable code, maybe. Oh, and I've used the TI MSP430 which is actually a 16-bit micro, but mostly in C. The 8051 is probably the most popular 8-bit micro with 15 or 20 manufacturers, and some cool peripherals such as on-board 24-bit ADCs, but few of those come in hobbyist-friendly non-SMT packages. I use the PIC too and as a factory approved consultant (even as not), I can see good reason to recommend it in many cases. One reason is that if you post a problem code snippet here or in c.a.e. or a.m.8bit you will likely get help from multiple sources.

  • Instructions such as bsf PORTA,0 which is supposed to set bit 0 in port A actually read the entire PORTA *pin levels* in, perform a logical "OR" with 0x01 and then write the new value back to the PORTA latches. If another pin is heavily loaded and/or if you've just written a new value to PORTA and the clock speed is fast, you may end up inadvertently setting *other* bits to the wrong value. The 18F series provides a second location (LATA) for each port that reads from the latch values rather than the pin levels and thus avoids the problem entirely. Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

It was more than 5 minutes to code, but you may want to have a look at our ELM381 chip. Set pins 2 and 3 low, and with a 60Hz reference you get a 1 sec pulse out of pin 6 every hour. It is 12C508 based btw.

--
   Jim Nagy
   Elm Electronics
Reply to
Jim Nagy

I swear, as Dog is my witness, this is the very first time in lo these

55 years that I've heard of a programmable part that works with a Vpp of +5V. Is this what "flash" is? Where is there a chart with a breakdown of various kinds of memories?

Thanks, Rich

job.

Reply to
Rich Grise

Thanks, but can you say this again, in English?

Thanks, Rich

Reply to
Rich Grise

Sorry, but you have to admit a programmer from Microchip is a little more sophiscated :-)

I still like your programmer too though.

Al

Reply to
Al Borowski

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.