Part Selection and Schmitt Trigger Oscillator
I often obsess over little details of my circuit designs, and the daisy-chain adapter for Floppy Emu is no exception. The design needs a small CPLD for the daisy-chaining logic, and for various reasons I have narrowed the choices to the Lattice ispMACH LC4032ZE and LC4032V. These are both 32 macrocell CPLDs, and are very similar except for a few details:
LC4032ZE – 48 pins, 0.5 mm pin pitch, 1.8V core, built-in oscillator
LC4032V – 44 pins, 0.8 mm pin pitch, 3.3V core
The 4032ZE is the newer of the two options, and the 4032ZE supply at distributors is a bit more plentiful. It also has a built-in 5 MHz RC oscillator with +/- 30% accuracy, which can be divided down to the kHz range or lower frequencies without using any macrocells. As it happens, the daisy chain adapter needs a clock source in the kHz range for periodic tasks, but the exact frequency isn’t too important, so this is perfect.
The drawbacks of the 4032ZE are its core voltage and its pin pitch. With a 1.8V core serving 3.3V I/O to and from 5V disk drives, I’d need to design a three-voltage system. In practice that means an additional voltage regulator, some extra decoupling capacitors, and a bit more headache with the board layout. 0.5 mm pin pitch means the pins are very tightly spaced. It creates a greater likelihood of soldering errors and hard-to-see solder shorts during assembly. Basically it will make assembly and testing of boards more challenging.
The 4032V looks like a good alternative, with a 3.3V core and a much wider pin pitch. But it lacks any built-in oscillator. If I want a clock source, even an inaccurate one, I’ll have to provide one externally. That will add a bit to the board cost and complexity. The 4032V itself is also slightly more expensive than its twin. In the end, it’s not obvious to me whether the 4032V or 4032ZE is the better choice overall.
Which one would you choose?
Schmitt Trigger Oscillator
If I choose the 4032V, then I’ll be looking for a simple and inexpensive way to provide an external clock signal to it. Something around 10 kHz would be preferred. I can probably tolerate inaccuracies in the frequency of 50% or more, over time on the same board or between different boards.
I could use a single chip oscillator like a MEMS oscillator, but I’m drawn instead to the idea of a Schmitt Trigger RC oscillator. It’s cheaper, and it also has a nice old-school vibe. The circuit is simply a single inverter with its output fed back to its input through a resistor, and with its input also connected through a capacitor to ground.
The frequency of the Schmitt Trigger RC oscillator depends on the values of the capacitor and resistor, the hysteresis of the inverter, and the supply voltage. Calculators exist to help predict the frequency, but in practice I’d probably need to tune it experimentally.
I’m fine with some variation in the frequency, as long as it doesn’t vary wildly. A variance of 2x or more could become problematic. Given the tolerance of the capacitor and resistor values, temperature-dependent capacitance changes, process variations between inverters, and possible supply voltage fluctuations, what range of frequency variation is a Schmitt Trigger RC oscillator likely to experience?
Would I be better off paying more for a standard oscillator, even though I don’t need the high accuracy? Or would I be better off using the 4032ZE with its built-in oscillator, and not stressing about the core voltage and pin pitch?
Read 7 comments and join the conversation7 Comments so far
Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.
IDK if this is the case with your parts, but usually I’ve seen that logic chips need to have a stable clock before they are released from reset. I don’t know if a Schmitt trigger osc will be stable by the time the CPLD comes out of reset. You may need additional external logic to ensure timing there.
Personally I’d use the LC4032V and some standard osc. You won’t need another voltage rail (cost and more difficult routing) and that other smaller pin pitch seems difficult. Esp if you’re assembling them yourself.
go retro: 555 and the 32V
I’ve decided to go with the LC4032V to make design and assembly easier, but still haven’t decided between the Schmitt trigger RC oscillator vs the single-component oscillator. The single oscillator would be the sure solution, but would add about $1.00-$1.50 to the likely retail price of the finished product. The Schmitt trigger oscillator would probably work fine, but would involve more uncertainty. Its performance and behavior would be very similar to the CMOS version of 555 when configured as an astable oscillator.
Why not use a PIC10F320 or so? They\’ve got a 3% internal oscillator that can be routed to a pin; you can choose any power of 2 between 250kHz and 16MHz for the frequency. And they\’re $0.47 at qty 25 if you get them from digikey.
Actually that gives me an idea. Maybe I don’t need a CPLD at all – maybe I could build the whole device from a microcontroller running a tight loop of code. The response time to disk enable input changes would be measured in tens of microseconds instead of nanoseconds, but that would probably still be fast enough to work. And (with the right choice of MCU) it would enable a purely 5V design, and eliminate all the voltage regulators, level shifters, etc. Let me see if I can test something on a breadboard using parts I already have.
A thought, don\’t know if it\’ll help. Some of the newer PICs have a CLC, which is basically a PLD logic cell. You might be able to use that to generate your logic. There\’s typically 4 per part.
I did one design where I used those cells to implement a special pattern generator; it worked for me.
In case you’ll decide to go for an MCU instead of the CPLD, I’d suggest you to consider one of the Nuvoton ARM chips. They are probably not as widely known as its Atmel, NXP, ST opponents but in general they are at a very good price point (sorry if you already have any experience with that manufacturer I’m just sharing my thoughts). The company offers fairly good support on software side like BSP, Standard Peripheral Library and sample source codes. Downloaded from github example projects can instantly be used with Eclipse/GNU MCU, IAR EWB and also with Keil MDK. A great majority of their Cortex-M0/M4 variants have wide supply voltage range from 2.5V to 5.5V so you don’t have to deal with the logic level translation.
Here is a random selection of a few Cortex-M0 devices with 5V supply voltage that may fit your needs (Package, Speed, Flash, RAM and Price are listed) based primarily on the price:
M058SFAN (TSSOP-20, 50 MHz, 32K/4K) $1.13
M058SLAN (LQFP48, 50 MHz, 32K/4K) $1.55
Or if you feel that you need more horsepower with lower interrupt latency and hardware FPU you can also check this Cortex-M4 one (I think its price is very impressive in this league). Of course, it’s also a 5V device:
M451LD3AE (LQFP48, 72 MHz, 72K/16K) $1.68
Starting from 100 pcs you’ll get 24% discount on the price while from 500 pcs you’ll get 34%. At higher quantities you can get even more.
All of their MCUs contain 22.1184 MHz internal precise RC oscillators trimmed to 1% at 25°C/5V, and they also have a 10 kHz one with 30% deviation. There’s an enormous list of variants so check yourself which one would be the best for you to implement the existing CPLD logic in software (if that’s possible at all).
One thing you need to consider that all LQFP packages have 0.5 mm lead pitch (the smaller 7mm LOFP64 and the LQFP128 packages have only 0.4 mm) so it may be a show stopper for you. TSSOP can help a bit but if your design needs more I/O pins then probably the benefits are worth to solve the manufacturing issues at 0.5 mm resolution in return for the reduced component count.
These devices have very simple peripherals they are nothing fancy which is a plus when you just start working with them. I have also worked with Atmel (Microchip) SAMC21 and SAMD21 devices and most recently with LPC51U68 from NXP. Especially the latter was a nightmare to achieve a good understanding at the peripheral register level but of course is a very capable device if you get familiar with it. But this may only be my subjective opinion.
Atmel on the other side has very detailed and slightly “cryptic” data sheets that may require you to read them over and over again until late night till you understand correctly. 🙂 The SAMC21 for example has a very elegant peripheral design like the Clock System / Generic Clock Controller and a beautifully sophisticated register synchronization scheme which enables manually controlling the register reads/writes on the APB and AHB buses using synchronous and asynchronous clocks.
OK, just to shut down this brainstorming and sum it up: the 5V capable SAMC21 and Infineon XC1000 series would also be good for you but they are in much higher price range. Furthermore, component sourcing can also be challenging as there are not many distributors of Nuvoton MCUs all around the world (Digikey maybe, but they’re using higher prices). Personally I have good experiences with techdesign.com and Nuvoton Direct. Dispatching from Taiwan usually I get the package in a few days here in Europe after the customs procedure finishes. A nice feature I saw at Techdesign by the way that when you order you’ll instantly get 90% discount on the first 5 pcs of each different devices. This may be interpreted as an option for purchasing samples for evaluation at a very low price.
I’m an old guy emotionally biased toward the 8-bit era in strong way. I was sticking to 8 bit devices like PICs, AVRs and 8051 and so on for ages. It was a very hard move to deep dive into the 32-bit world and I resisted as long as I could. But nowadays I wouldn’t poke any 8/16-bit MCUs unless I have a very good and justified reason for doing so. Hobby projects are of course exceptions. 🙂
Hope this help or at least you have not fallen asleep while reading.
Some useful links:
https://www.nuvoton.com/hq/products/microcontrollers/arm-cortex-m0-mcus
https://www.techdesign.com/market/nuvoton/Microcontrollers/Microcontrollers
https://direct.nuvoton.com/en
https://github.com/OpenNuvoton/NuMicro-M0-M23-Family
https://github.com/OpenNuvoton/NuMicro-M4-Family
PS: No, I’m not a Nuvoton salesperson. 😛