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

0 Members and 1 Guest are viewing this topic.

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #100 on: October 21, 2014, 02:33:55 pm »
I use an USB extension cable instead of hooking it up directly to the PC because the extension cable grips better.

The prototype board as it comes from Cypress has the blinking program on it and blinks at around 1 or 2 Hz, but if you are pressing the button when pluging it in, it should blink at a faster rate. Let me actually measure the frequency but by eye it was about 3 to 4 Hz, I'm ready to go to work so I can't check until Noon.

The thing is that if inserted normally it should blink at a slower rate than when you hold the button while inserting it.

As for the Com5 is that the one built in the computer? and attached to the board bypassing the header?  I have not ever tried to program it with a USB/Serial cable directly.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #101 on: October 21, 2014, 03:04:06 pm »
The single remaining issue is getting the Cypress USB/serial port installed. What drivers did you use?

The Cypress USB/serial shows up as com10. However any attempts to select it with Bootloader Host or change port in Device Manager causes it to stop responding and my PC hangs. My generic USB/serial (com5) is stable and available as an option but programming results in "can't read target" error.

The blue LED does blink faster (exactly 2 hz measured by scope, 1hz without button pressed) so the loader seems to be activated.

My motherboard com1 and generic USB/serial com5 are available but can't program. Would it be possible for you to test with your com1 or another USB/serial? I would like to program these chips one way or another.

The single remaining issue is getting the Cypress USB/serial installed. I've been trying for several hours and the Cypress port is not functional. Would it be possible for you to try programming with your com1 or another USB/serial?


 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #102 on: October 21, 2014, 03:38:51 pm »
I used PSoC 4 Prototyping Kit Guide

http://www.cypress.com/?docID=48142

And the document installed on the Start menu, under Cypress/Cypress USB-Serial/Documentation/Cypres USB-Serial Driver Installation Guide.pdf might help on the specifics


 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #103 on: October 21, 2014, 04:09:15 pm »
So you installed the entire USB/serial SDK package just for a driver? It takes me close to an hour each time with dotnet and win installer updates.  It's bigger than Creator which is gigabytes. After numerous attempts using that USB SDK Kit it shows up as com10. But selecting it with Bootloader Host or change port in Device Manager causes it to stop responding and my PC hangs.

I sent 3 emails to the various Cypress addresses and opened a website case asking two questions:

1. Is there any other driver package besides Cypress USB/serial SDK?

2. Should it be possible to use a generic USB/serial instead of the Cypress one?

No response since yesterday.


 
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #104 on: October 21, 2014, 04:16:37 pm »
I just took a quick peek on that prototyping kit guide I linked.

Kit Software under Software installation has the link to PSoC Creator and another one for EZ-USB Software Development Kit (SDK)

it has the following link:

http://www.cypress.com/?rID=83110

and the driver is in there (9 MB) requires you to log in to cypress.

You can get the USB-Serial SDK installer from there too. but I guess that's up to you. The USB/UART part of the prototype kit is configurable if you later want to play with other protocols like I2C or SPI, not sure what other modes it allows at the moment with their CY7C65211-24LTXI chip.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #105 on: October 21, 2014, 04:23:42 pm »
From that page you want "USB-Serial Driver Installer" that downloads CypressDriverInstaller.exe
and also get the USB-Serial Windows Driver Installation Guide pdf file for specifics on how to install and configure the driver.

edit: It's been a while since I did install mine so but I usually follow the guide so that's probably what I did. I didn't get the Pioneer until later so I probably only installed the necessary parts, then later on I started to play with the other chip in the board, so I probably got the other piece of software, not sure since it was months ago, sorry.
« Last Edit: October 21, 2014, 04:26:00 pm by miguelvp »
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #106 on: October 21, 2014, 04:28:31 pm »
Yes, I tried all of the above. There are two other guides and other driver packages too. The easiest was to use windows wizard and direct it to \Cypress\Cypress USB-Serial\driver\cyusbserial\bin\wxp\x86. This works some of the time but it still hangs.

Guess I'll wait for Cypress to get back or set aside another couple days to experiment. So far more time spent than all the other ARM chips and tools combined. So far more money spent than all the other ARM chips and tools combined. I should have rechecked the process again before ordering that new batch of chips. Live and learn. In any case thanks for your effort.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #107 on: October 21, 2014, 04:46:11 pm »
I have it installed in three computers and none of them gave me any trouble, including my old XP 32 bit machine.

Is the driver not installing or is it installing but not acting right?

what baudrate and setting do you have that com port at?

I'm sorry your COM port is giving you so much trouble. Do you have more than one USB port?

I'll be home for lunch in 15 minutes or so I'll see how it acts when connected with the button unpressed or when pressed, I think one of the modes brings 2 devices at once, an HID and the USB one but not sure.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #108 on: October 21, 2014, 05:37:04 pm »
When I plug it in with the button pressed windows beeps once, on unplug it beeps twice.

Here are my port settings


Advanced


Driver


Driver Details
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #109 on: October 21, 2014, 06:27:32 pm »
That might be the key. I just used those settings, not for Cypress USB/serial, but for my generic one and it appears to program without errors now and the blinking went back to 1hz which is a good sign. Changed in Dev Mgr and Bootload Host from 9600 to 115k maybe did the trick.

I need to go out with a client right now but when I get back time to fire up the scope. It was very depressing but now I'm excited again. PSOC is GCC plus the lowest cost (albeit 40xx) of all ARMs so I really wanted to get into these. Also maybe cheap $4 programmer or even less if bare chip works with the Python. Fingers crossed and thanks.

 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #110 on: October 21, 2014, 11:40:38 pm »
Back to oscillation then. I just noticed that I can't output a fractional clock since it's aliased by HLFCLK and since that one at the moment is derived from the internal 48MHz or 24MHz IMO, the output clock is not stable.

But a 4MHz crystal should work fine for now. Later if you derive the HLFCLK from the EXTCLK the output pin shouldn't have any trouble outputting the fractional clock, at least that is my hope.

Maybe changing some output pin settings take that dependencies away, but so far I only get a clock if referenced to HLFCLK

 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #111 on: October 22, 2014, 12:41:51 am »
With the 4mhz crystal 4.7meg R and no caps it oscillates at expected frequency. Touching with finger or scope on input stops it so gain probably not as high as a real inverter. With optimum R and caps stability should improve. But it works! You have proven we may be able to overcome the serious omission of internal crystal oscillator at the cost of a digital block. If this can actually drive the CPU then PSOC4 is again in the lead as one of the better choices for ARM MCU.

For a real world test we need to disable the internal clock and run from EXT_CLK. Can you do this? I looked at the code (clock.c?) and none of it  made sense. In fact none of the code resembles C to me. Can you put up an EXT_CLK version or tell me what to change?

ps, Maybe also a good idea to blink at 10hz not 1hz because of the slower clock.
« Last Edit: October 22, 2014, 01:13:00 am by paulie »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #112 on: October 22, 2014, 01:16:07 am »
That's good news and it matches my speculation on the output pin settings needed to generate an output clock.
However when it starts oscillating what HLFCLK is it using? the internal one until EXTCLK is stable? if that is the case then only fractions of 48MHz will work.

Also on the lower frequency ones like the one you have that maxes at 24MHz the IMO can still do 48MHz and so can the HLFCLK, but the SYSCLK has to be divided by at least 2 since it can't get past the 24MHz, however, even if HLFCLK can still run at the full 48MHz they can't run faster than the SYSCLK, and PSoC Creator will complain. Sorry if I lost you on that. Not really that important other than the base clock can be higher than what the MCU is rated at.

Do you still have the $4 programmer setup? If so and since you resolved the serial port problem, you should be able to program the 28 SSOP chip with the first HEX file I posted.

While you work on that I'll try to see if I can make a bootloadable program that will allow for the clock to be EXTCLK. The problem with that is that the bootloader has it's own chip configuration and will use the IMO, then when it loads the bootloadable configuration then it will use the EXTCLK, so not sure how that will affect the crystal while it's transitioning

The good news however, is that you can use a more accurate 48MHz clock regardless.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #113 on: October 22, 2014, 02:29:16 am »
Ok, I did a bootloadable image that switches from the bootloader internal 48MHz IMO, to the bootloadable EXTCLK driven clock.

I also added this so you can measure the crystal freqency in P1[7] and half frequency at 50% duty cycle after passing via a d-flip-flop on P1[6], those are just next to a ground pin so it will be easy to probe without a lot of ringing with a ground wire and no ground lead on the probe.


It's still bootloadable so you can reprogram it, but without the crystal it's free running and actually I get some internal frequency driving the LED (looks like it runs at half intensity), with a 4MHz crystal is supposed to blink at 1 Hz

Weird thing is that without the crystal P1[6] outputs 15.75MHz meaning that internally it think EXTCLK is double that (31.5MHz) not sure why that is happening. P1[7] without a crystal shows just noise, but didnt' measure the frequency of the noise spikes. Edit: unsure now if this is P1[6] might be P1[7] but one of those definitely has a clock driving it even if both are supposed to be based on EXTCLK.

Edit: Not sure why I'm measuring 5 volts on the output either without the crystal in place. Maybe it routes the full VDD to the pin I measure it at. (Had it running for 10 minutes and the chip is ok with it so far) with no crystal, the crystall should bring that signal down to 3.3V (maybe since I don't have any load on that pin)

I'm attaching the project as well. should compile like the other one and you should be able to program it the same way.

Edit: The important thing here is that, if the on board LED blinks once a second with a 4MHz crystal, it's working as it's supposed to. If you want to try other crystals and you want me to change the parameters so it blinks at 1Hz let me know, I would assume that a 1MHz crystal will make it blink once every 4 seconds.
« Last Edit: October 22, 2014, 02:41:25 am by miguelvp »
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #114 on: October 22, 2014, 11:31:54 am »
I get some internal frequency driving the LED (looks like it runs at half intensity), with a 4MHz crystal is supposed to blink at 1 Hz

Not if you are putting a 15mhz signal into the LED which seems to be what my scope shows. I would expect it to show dim. Maybe you forgot that LED is on 1.6 or maybe I don't understand. Anyway I get the same results you describe above but not sure what use it is. Wouldn't it be better to output that clock signal on a different pin, say 1.4?

IMO 1hz ain't the best rate because that's similar to the factory demo and the boot mode indicator. I would want it to go at say 10hz for the fastest clock expected. Also because 4 sec is a long time to wait for results.

Since I had bad luck with the $4 programmer/Python I'm inclined to use the demo board as just a target until the new chips come in. Then there will be more than one target so my plan is to see if I can get that working again at that time. Ultimately port it to a bare chip so it will be a "$2 programmer" and I'll have a backup.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #115 on: October 22, 2014, 04:52:01 pm »
Duh, I guess it didn't realize the PWM is also hooked into the LED, so it took the association away from the PWM.

Double click on "Bootloadable Blinking LED.cydwr"
And change the pins there. Change the one I named Pin_1_6 to use P1[4] and restore LED to use P1[6]
I'll change the project this afternoon after work.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Crystal oscillator with logic gates implemented on a PSoC chip - possible?
« Reply #116 on: October 23, 2014, 02:42:03 am »
I changed the blinking to 10 hertz and the clock to output to P1[4]

Running without a clock still shows a high frequency now on P1[4], also 10 Hz makes the blink run pretty quick so it might not be a good indicator to tell if the EXTCLK is working.

Edit: it will remain at 10Hz if the target clock is 4MHz since it derives the clock based on the EXTCLK
« Last Edit: October 23, 2014, 03:41:03 am by miguelvp »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf