Author Topic: Crystal oscillator with logic gates implemented on a PSoC chip - possible?  (Read 27860 times)

0 Members and 1 Guest are viewing this topic.

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #50 on: October 19, 2014, 03:08:31 am »
PSoC 4, that they OP is trying to use, can't do it because the datasheet doesn't even mention it

I'm not sure if you refer to internal oscillator support or inability to implement an inverter. If the latter then just because it's not mentioned don't mean it can't be done. I assume the sheet don't expressly forbid creating an inverter with a DFB.

Your constant mention of "driving" a crystal is  a bit confusing. Crystals aren't so much driven as used as frequency element in an oscillator which only requires an inverter between two pins. I was under the impression this was possible with PSOC4 but admit to having little experience with digital block here. You are more up to speed on these and may know something I don't.

It would not only solve the OP issue but also overcome what might be considered the only major drawback for this particualr part. Namely lack of dedicated crystal support like present on virtually all other MCUs.
 

Offline lgbeno

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: 00
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #51 on: October 19, 2014, 03:27:02 am »
2 oscillators and a Max 10 FPGA and the OP's design would be done already....
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #52 on: October 19, 2014, 03:31:33 am »
Not referring to the Internal Oscillator at all.

The PSoC 3, 5 & 5LP on their datasheet have XTAL pins.
The PSoC 4 only has and EXTCLK pin meaning that it can take an external clock, but you can't connect a crystal directly to it, this is done by design.

Is there a way to use, say, analog input and output pins to do it, or some obscure configuration? maybe, but that's not intended so it can't be regarded as a solution.

So he can add a darlington based crystal clock and feed the external generated clock to the chip for 5 cents more on parts than hooking it directly, or forget about it.

By driving it I mean making the XTAL resonate and give the needed clock frequency. The PSoC 4 is not designed to do that, but it does however take an external clock to override the internal RC clock.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #53 on: October 19, 2014, 03:35:55 am »
2 oscillators and a Max 10 FPGA and the OP's design would be done already....

The OP already has the clocks oscillating with his NAND gates, he just needs to feed those clocks to the PSoC, no need to add an FPGA, although I want Arrow to get their act straight and get some MAX 10 in stock. Will like to see what analog goodies it has to offer.

BTW, not sure the Max 10 FPGA will allow the OP to implement a Pierce Oscillator with just two caps and a crystal. That's the whole problem the OP brings about if these fabric logic gates act the same as hardware dedicated ones.
 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #54 on: October 19, 2014, 03:53:10 am »
Haha... $30 fpga to drive a $2 chip. I'm sure that was intended as humor.

Is there a way to use, say, analog input and output pins to do it, or some obscure configuration? maybe, but that's not intended so it can't be regarded as a solution.

I'm not sure that Cypress dictates exactly what their circuits can and cannot be use for. According to docs the op amps can definitely be routed as an inverter between two pins and will definitely function as an oscillator. Highly unlikely gain bandwidth supports 48mhz or any useful clock frequency.

We know there is a clock input otherwise there would be no constant mention of external clocks. The simple question is can a digital gate be connected between two pins. It looks like I'm not the only one here unable to answer that.
 

Offline lgbeno

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: 00
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #55 on: October 19, 2014, 04:05:01 am »

2 oscillators and a Max 10 FPGA and the OP's design would be done already....

The OP already has the clocks oscillating with his NAND gates, he just needs to feed those clocks to the PSoC, no need to add an FPGA, although I want Arrow to get their act straight and get some MAX 10 in stock. Will like to see what analog goodies it has to offer.

BTW, not sure the Max 10 FPGA will allow the OP to implement a Pierce Oscillator with just two caps and a crystal. That's the whole problem the OP brings about if these fabric logic gates act the same as hardware dedicated ones.

Yeah, IMO it's a clever trick to try to drive a crystal with a NAND gate (internal or discrete) but also a risk. 

Sure a proper oscillator adds some cost but  it is tested and proven to work over time, temperature, process variation, etc, etc, etc.

Just bite the bullet and he probably won't look back and regret the decision.  Do the math: what is the volume, how much extra does it cost to do it right?  How does that number compare to what it would cost to deal with an issue that crops up in production or worse yet, when the product is in the field...  How much does your time cost fiddling around with something when the other approach is a drop in?  Have much does a cup of coffee at Starbucks cost?  If that all makes sense then I'm all for solving the original problem.

The reason that I suggested a proper FPGA is that they for sure have multiple clock domains so they easily meet the OP's criteria listed.  I don't know much about PSOC4 but it sounds like it doesn't.  Just to be clear I'm suggesting to replace the psoc with max 10.

I have not played with max 10 either but it does look slick.  I'd wait for the dev board to be available from Terasic and go that route.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #56 on: October 19, 2014, 04:41:16 am »
They do, for example this is a reference of the external Xtal on the 5LP

And this is a reference to the EXTCLK on the PSoC 4

On the 5LP on the pin names there are 4 XTAL pins, 2 for the High frequency clock to override the IMO and 2 for the low frequency clock to override the ILO.


On the PSoC 4 pins there is not one named XTAL only one named EXTCLK


Of course on the datasheet they don't even mention the EXTCLK in the block diagram this is the only reference to it, other than their specification of frequency and duty cycles.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #57 on: October 19, 2014, 04:59:11 am »
I have not played with max 10 either but it does look slick.  I'd wait for the dev board to be available from Terasic and go that route.

Well, thanks to this thread I noticed that Arrow finally had some stock.(Even if I did setup an alert it never notified me)
But I did order one for $30.

http://parts.arrow.com/item/detail/arrow-development-tools/bemicromax10

The problem with Arrow is usually they are a bit behind with documentation and sample code so I wouldn't recommend their kit for someone starting. Plus they have their own proprietary GPIO pins although one of them is Terasic compatible, and then the edge connector is proprietary as well. It doesn't hurt that I already have an interposer for the 80 pin connector.

 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #58 on: October 19, 2014, 05:14:41 am »
Of course on the datasheet they don't even mention the EXTCLK in the block diagram this is the only reference to it, other than their specification of frequency and duty cycles.

Actually along with clearly labeling  EXT_CLK on P0.6 they do mention further:

Quote
The clock system for the PSoC 4100 consists of the IMO and the
ILO internal oscillators and provision for an external clock.

Also additionally described as an option for use as the HFCLK CPU system clock along with detailed frequency and duty cycle specs for it. This was never in dispute. No crystal would be crippling but without an input a truly fatal flaw.

The single actual question is and always was whether an inverter can be implemented between two pins. It's gratifying to see I'm not the only one learning how these things work.

« Last Edit: October 19, 2014, 05:17:58 am by paulie »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #59 on: October 19, 2014, 05:54:46 am »
External Clock being a single pin on the PSoC 4. Edit: and by no mention in the block diagram I mean the block diagram. The IMO internal RC clock sits by itself in that diagram, no mention of the EXTCLK, but yeah the document does explain you can place an external (already oscillating) clock on pin P0.6 and I did point that out many times in this thread.

No provisions for an inverter on the PSoC 4 for an external XTAL, no mention of XTAL other than the glossary but without any other references through the datasheet, unlike the PSoC 3, 5 & 5LP where they mention it and label the pins.

So, as far as the datasheet is concerned, there is no support for what the OP wants to do.

I don't think 16 cents at most for an external part is a show stopper, there is no much needed to oscillate an external crystal without having the MCU do it for you (and using the extra pin at that).

« Last Edit: October 19, 2014, 05:58:22 am by miguelvp »
 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #60 on: October 19, 2014, 06:11:24 am »
External Clock being a single pin on the PSoC 4. Edit: and by no mention in the block diagram I mean the block diagram. The IMO internal RC clock sits by itself in that diagram, no mention of the EXTCLK

? ? ? ? ? That was interesting reading. Internal? RC? My quotes and the diagram you posted with EXT_CLK are pretty clear. Maybe review your own attachment:



ps. Anyway I have a pretty good picture right now where everybody in this thread sits regarding hardware and software competence and state of mind. Probably not much more to discuss at this time and so let's give it a rest for now.

« Last Edit: October 19, 2014, 06:20:41 am by paulie »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #61 on: October 19, 2014, 06:22:07 am »
External Clock being a single pin on the PSoC 4. Edit: and by no mention in the block diagram I mean the block diagram. The IMO internal RC clock sits by itself in that diagram, no mention of the EXTCLK

ps. Anyway I have a pretty good picture right now where everybody in this thread sits regarding hardware and software competence and state of mind. Probably not much more to discuss at this time and so let's give it a rest for now.
Whatever you say.

Here is their Datasheet diagram, as I mentioned, no signs of the EXTCLK next to the IMO


Edit: but most importantly no mention of Xtal or external crystals anywhere in the document.
« Last Edit: October 19, 2014, 06:30:31 am by miguelvp »
 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #62 on: October 19, 2014, 06:24:33 am »
My quotes and the diagram you posted with EXT_CLK are pretty clear. Maybe review your own attachment:

 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #63 on: October 19, 2014, 06:32:37 am »
My quotes and the diagram you posted with EXT_CLK are pretty clear. Maybe review your own attachment:



Yes, IT does support an External Clock, no one denies that, at least not me. Edit: I've been saying all along you can use pin P0.6 to do so!.
They Don't support an external XTAL you gotta make that clock oscillate externally and then hook it into P0.6 and everyone is happy. No inverter between two pins, just a single clock pin to override the internal RC clock.
« Last Edit: October 19, 2014, 06:34:49 am by miguelvp »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #64 on: October 19, 2014, 01:09:05 pm »
Quote
IMO it's a clever trick to try to drive a crystal with a NAND gate (internal or discrete) but also a risk. 

Not sure why it is a "clever" trick: it is done every day gazillion times in pretty much every mcu / crystal oscillator. That's the way it is.

You cannot get any simpler / plainer than that.
================================
https://dannyelectronics.wordpress.com/
 

Offline randsl

  • Contributor
  • Posts: 40
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #65 on: October 19, 2014, 01:38:17 pm »
Hi all,

Thanks a lot for your efforts & thoughts to answer the question raised by me...

Hi miguelvp,
I tried the project you posted in Cypress forum. That one is also does not work.

I understand that my idea is not going to work with PSOC4.
The two frequencies needs to be stable and 2% accuracy with the internal osc. is not enough for my application.

Initially I planned to use a MSP430 micro on the system with two oscillators built up with NAND gate & Xtals.
I think it's easier for me to switch back to my initial plan with MSP430 and gave up on PSoC4 idea.

Thanks again for your thoughts and help.

cheers,
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #66 on: October 19, 2014, 04:19:47 pm »
Quote
The two frequencies needs to be stable and 2% accuracy with the internal osc. is not enough for my application.

A typical way to generate frequencies out of a mcu is to use pwm. You may have to work out the math to see what the error rates are for your set-up.

Otherwise, using an external oscillator or two crystals + NAND gates would work.

I don't know the specific chip but many mcus offer the ability to trim its internal oscillators. And some mcus offer internal oscillators of high precision - I think some PICs have 0.1% intosc.

Moving to a different chip due to frequency generation seems to be too drastic of an approach to me.
================================
https://dannyelectronics.wordpress.com/
 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #67 on: October 19, 2014, 05:58:15 pm »
I agree with dannyf (yikes!) that it's silly to resort to other chips or any extra components at all. Moving to an fpga that costs 20x more don't strike me as a smart move either.

Miguel does not seen to get the point. Might be language barrier or maybe friday and saturday nights are not a good time to try explaining things like this. Just for the benefit of anyone who might be more familiar with PSOC4 programming here it is again for about the tenth time:

The chip has an external clock input. If an inverter can be implemented between two other pins using a digital block then a crystal can be attached which will oscillate and drive that input. This will overcome the lack of dedicated internal crystal oscillator and allow PSOC4 to perform like other MCUs.

PWM, d-flops, internal RC, etc have nothing to do with this. The question is can an inverter be implemented between two pins on this chip. If you don't understand what I am saying please don't respond again with more irrelevant or repeated comments. Just ignore me. One last time:

The chip has an external clock input. If an inverter can be implemented between two other pins using a digital block then a crystal can be attached which will oscillate and drive that input.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #68 on: October 19, 2014, 08:13:39 pm »
Short answer is no you can't.

The PSoC 4 has a High Speed I/O Matrix (HSIOM) that the PSoC 3,5&5LP didn't have. As seen in the bottom part of the block diagram:

PSoC 4 (ignore the highlights, just didn't feel like uploading new pictures)


The PSoC 5 connects the pins directly to the digital interconnect: (ignore the highlights, just didn't feel like uploading new pictures)


There might be a way to configure the HSIOM, feel free to dig through the TRMs I/O System to find out (section 7.6 High-Speed I/O Matrix)

PSoC 4 TRM (look at the I/O Sytem section 7)
http://www.cypress.com/?docID=48637

PSoC 5LP TRM (I/O system section 19)
http://www.cypress.com/?docID=46050

I don't know how much delay that HSIOM module produces but what is clear is that the pins are no longer connected directly to the digital system interconnect.

There "might" be a trick, there are so many configuration options including drive modes and clocks, the OP could set the input pin to be driven with an external clock (inverted) and connect that to the output port. That might do the trick but again I doubt it.
 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #69 on: October 19, 2014, 08:29:06 pm »
It's not possible to build an inverter between two pins? As far as "digital building blocks" go I must say I'm not impressed. End of story.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #70 on: October 19, 2014, 08:36:35 pm »
Hi all,

Thanks a lot for your efforts & thoughts to answer the question raised by me...

Hi miguelvp,
I tried the project you posted in Cypress forum. That one is also does not work.

I understand that my idea is not going to work with PSOC4.
The two frequencies needs to be stable and 2% accuracy with the internal osc. is not enough for my application.

Initially I planned to use a MSP430 micro on the system with two oscillators built up with NAND gate & Xtals.
I think it's easier for me to switch back to my initial plan with MSP430 and gave up on PSoC4 idea.

Thanks again for your thoughts and help.

cheers,

If you configured a 42MHz external oscillator to drive the PSoC external clock you can get the 5.441MHz with a 7+23/32 fractional divider that is sync'd to the system clock. Meaning it wouldn't matter how accurate your clocks are if they fall out of sync from your MCU.
Then use an external oscillator with to bring in the 5.510Mhz clock.

Also I thought of something. You could setup the input pin to be inverted (under the clock selection) or to be an external clock inverted. and wire it to the output pin directly without the NOT gate because it should already be inverted, but I have the feeling the Hight Speed I/O Matrix gets in the way regardless.

Analog pins can bypass it I think but not enough bandwidth for your clock.

Maybe you could ask the PSoC Sensei blog: http://www.cypress.com/?id=2401
in the comments for http://www.cypress.com/?rID=80799&cache=0

Or Asha Ganesan at the cypress forums seems to know about the HSIOM module
http://www.cypress.com/?app=forum&id=4749&rID=89410
But has not been active since January.




 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #71 on: October 19, 2014, 08:44:00 pm »
It's not possible to build an inverter between two pins? As far as "digital building blocks" go I must say I'm not impressed. End of story.

You CAN build an inverter between two pins, probably not to get a crystal to oscillate,but for all other intents and purposes it's a non issue. If you have a digital signal (even a clock) coming in and you need to invert it, it will handle that just fine.

Or use the PSoC 3 or 5LP, that doesn't have that HSIOM module. But that module brings more features not possible on the other 2 chips.

Or study what the HSIOM can do, maybe you find a way.
 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #72 on: October 19, 2014, 08:58:42 pm »
You CAN build an inverter between two pins, probably not to get a crystal to oscillate

If you place a crystal across an inverter I personally guarantee it will oscillate. Maximum frequency depends on propagation delay.

Unfortunately I'm not in a position ATM to investigate how to make an inverter. It looks like no one else is either and since OP has left the building let's put this thread to rest.
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 1947
  • Country: nl
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #73 on: October 19, 2014, 09:22:50 pm »
Unfortunately I'm not in a position ATM to investigate how to make an inverter. It looks like no one else is either and since OP has left the building let's put this thread to rest.
Alternatively, you could give it a rest and let the rest just keep on going. :) You already know everyone's relative strength and weaknesses regarding hardware + software, so what new things could you possibly learn in this thread? Those of us who are less skilled however still find use for the information in here as presented by miguelvp. And yes I can actually read, thanks for asking. And on a good day I (and I suspect a good many other people as well ;) ) can even reason about what I just read, so no need to jump to the "rescue" about what you perceive to be the correct way to present information about the oscillatory goodness inside PSOC3/4/5. Thanks! :-+
 

Offline paulie

  • Frequent Contributor
  • **
  • Banned!
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #74 on: October 19, 2014, 09:33:47 pm »
You are welcome. And I'm glad you could take advantage of miguelvp's "expertise". But unless you can contribute to the original purpose of this thread which was to find a way to use crystals on a chip that can't do that then why not follow your own advice.

So far "oscillatory goodness" might not be the phrase to accurately describe this chip.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf