Shop OBEX P1 Docs P2 Docs Learn Events
Problem with FrequencySynth — Parallax Forums

Problem with FrequencySynth

youngdaveyoungdave Posts: 70
edited 2009-08-26 06:32 in Propeller 1
Dear All
I received my Propstick USB the other day, and have multiple LEDs flashing in all kinds of patterns under my command.
I’m having a problem with FrequencySynth. The only modification I’ve made is to change Frequency = 40_000 to Frequency = 4 to make things visible with an LED. FrequencySynth and Synth are in the same folder.
Nothing happens when I load FrequencySynth. What am I missing here?
I’m gonna top myself if I don’t get a solution within the next six months. Please help!
TIA David Young

Post Edited By Moderator (Bean (Hitt Consulting)) : 8/6/2009 11:20:58 AM GMT
«1

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2009-08-05 12:22
    Hello David,

    did you try to reduce the frequency in several steps

    best regards

    Stefan
  • youngdaveyoungdave Posts: 70
    edited 2009-08-06 02:58
    Tried reducing the frequency in steps. It made no difference.
    It seems that programs which don't call an external object run without problems.
    This suggests that the Propeller Tool can't find the called object (ie. synth). Shouldn't called objects be in the same folder as the main program (ie. FrequencySynth)?
    TIA David Young
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-06 03:40
    The Propeller Tool compiles any referenced objects along with the rest of the program. If it can't find the object, it will produce an error message and not produce a compiled program. There's something else you're doing that's causing the problem.

    You need to provide a schematic that shows how you actually have everything connected, then you need to attach your actual source program to a subsequent message using Post Reply and the Attachment Manager.
  • youngdaveyoungdave Posts: 70
    edited 2009-08-06 07:33
    Mike

    Thanks for your reply.

    * I have uninstalled and reinstalled Propeller Tool.
    * I have P0 > 160 ohm resistor > LED > GND. This setup works with LedsOnOff50Percent.spin without problems.
    * Source program is FrequencySynth with Frequency set to values between 4 and 40_000. I get the ‘Compilation Successful’ message at the bottom of the screen every time upon pressing F11.
    * No output on the LED connected to P0.

    TIA David Young
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-06 07:42
    Hi David -

    Welcome to the forums.

    Your description of the circuit is fine. Be sure you don't have VSS/VDD mixed up. Also be sure the LED anode/cathode are arranged properly.

    Tt sounds like the object/firmware is working just fine. Therefore, I suspect the problem may be within the program. In your previous post you referenced two programs. LedsOnOff50Percent.spin and FrequencySynth. Can you attach the programs?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • youngdaveyoungdave Posts: 70
    edited 2009-08-06 09:59
    Timothy
    Thanks for your reply.
    * VSS and VDD are OK.
    * I attach the files. FrequencySynth and Synth were downloaded from the object exchange. I’m using them unmodified.
    * LedsOnOff50Percent_mod is my modification of LedsOnOff50Percent provided with the Propeller Tool. It works perfectly.
    * When I hit F11 with FrequencySynth on the Propeller Tool screen, the ‘Compilation Successful’ message appears at the bottom of the screen whether Synth is in the same folder or not! Don’t both the referencing and referenced files have to be in the same folder?
    * I have installed the Propeller Tool on my XP machine. The same behavior occurs as on the Vista machine.
    TIA David Young
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-06 10:04
    The Propeller Tool looks in both the folder of the compiling project, the editor tabs and in the installed library of objects. I bet there is a FrequencySynth object in the library path and that is why you are not seeing a message. OK - let me check your files and get back in a couple moments.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-06 10:14
    I am on the same page with you now, thank you for attaching the programs. The FrequencySynth object is the "Top" object. Synth is a called object. In the Top object the I/O pin is set to 1. In a previous post you said you wired the I/O pin to P0. Therefore I suspect that the Propeller is working just fine, compiling just fine and the reason you don't see anything on the LED is because the LED is on the wrong pin or the program is pointed to the wrong pin.

    In the FrequencySynth object try changing the following and let us know how it works.

      Pin  = 1    
    
    



    to

      Pin  = 0
    
    



    If you are trying to modulate LED brightness, then I would recommend a PWM object or similar. Beau, who wrote the Synth object, also has a PWM object in the exchange. You can use the DutyCycle in the PWM object to vary the brightness. The PWM method is under scrutiny from me and I think it might not be functioning yet, so Beau is looking into this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • youngdaveyoungdave Posts: 70
    edited 2009-08-06 10:29
    Timothy
    * No, the LED being on the wrong pin is not the problem. I’ve got LEDs on P0 and P1, and neither shows anything.
    * I’m just fiddling with LedsOnOff50Percent_mod as a learning exercise. I need FrequencySynth to output a 3.6MHz signal.
    * Am I correct in assuming that it’s OK to run top and subsidiary objects from anywhere in the system, provided they're in the same folder?
    TIA David Young
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-08-06 10:31
    I wonder if it is that the objects are still zipped, from the archive, and the prop tool won't see them. I fell for that at first, explode them into another folder and the prop tool will be happy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • youngdaveyoungdave Posts: 70
    edited 2009-08-06 10:33
    No, everything is unzipped.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-06 11:05
    OK....nice, quick feedback.

    I just put the same firmware file you have used into my setup and everything is OK. Of course at Frequency = 40_000 the LED is solid, and at Frequency = 4 the LED is blinking. I powered on my Prop setup which has an LED on Pin 16. I then downloaded the above FrequencySynth file to my desktop. I opened the file. I pressed F8 and the program compiles. I can see that there is a Synth object in the tree on the right. The synth object has a blue folder indicating it is a library object. I think changed the Pin = 1 to Pin = 16. I then pressed F10 to recompile and download to ram using a Prop Plug. And the LED behaves as expected.

    When a program is compiled via F8, F10 or F11 the Propeller Tool first looks for the called objects in the editor tabs. The Program could have been opened from anywhere and if it is in the editor tabs it is used. If the program isn't found there, the Propeller Tool looks in the directory of the program being compiled. If nothing is there, then the Propeller Tool looking into the Library folder installed under the Propeller Tool directory.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-06 11:07
    Another thought - perhaps the crystal on the PropStick USB has come unseated? If this was unseated, it would prevent the Propeller from running at the 80MHz. needed for the Synth object, but the other program would run fine because nothing was declared for clock speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • youngdaveyoungdave Posts: 70
    edited 2009-08-06 11:33
    Timothy
    * The crystal is OK.
    * I’m pretty sure that the propstick itself is OK, and the object files are good. It’s starting to get right up my nose, so I’ll sleep on it. If you come up with any hot tips, let me know ASAP.
    * Your comment about the blue folder is interesting. I’ve never seen one on F8 (I’ve only seen it in the tutorial). I wonder if the directory structure within ‘Program Files/Propeller Tool V1.2.6’ is screwed up in some way? When I uninstalled and reinstalled the Propeller Tool, I didn’t clear out the files in ‘Program Files/Propeller Tool V1.2.6’. I wonder if it’s worthwhile to uninstall and reinstall again and clear out the directory structure at the same time?
    TIA David Young
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-06 11:37
    If you are getting a compiled program and it is downloading with a succesful message, then I don't think it is the PC at all. I am suspecting hardware. I will think about it. Maybe Mike or others has another great idea.

    Sleep well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • SamMishalSamMishal Posts: 468
    edited 2009-08-06 16:46
    Dave,

    I tried your program as you posted it and it works just fine.....

    I suggest you check your connections....also try a different pin

    Also I noticed in a previous posting you said P0 > 160 ohm ....



    The program is using P1 .....did you know this??



    Sam
  • youngdaveyoungdave Posts: 70
    edited 2009-08-06 23:02
    Sam
    * I have LEDs on P0 – P3, so changing the value of the Pin variable within this range is not a problem.

    The current situation is as follows.
    * The program FrequencySynth – Synth (using the external clock) compiles but doesn’t run.
    * The program Blinker1 – Output (not using the external clock) (from Spin Exercise 5-1 in the tutorial) compiles and runs.
    * This seems to indicate that compilation and calling of objects is not a problem, but that if the program requires the external clock, it won't produce any operation.
    * I wonder if the problem might be a dud crystal. Is this possible?

    * Timothy, you mentioned that the crystal may have become unseated. Do you mean by this that the crystal may simply need to be jiggled about in the connectors to make a clean connection, or something else?

    * Is the crystal just a standard 5MHz crystal available from any electronics supplier? If so I might buy one and try it.

    TIA David Young
  • SamMishalSamMishal Posts: 468
    edited 2009-08-06 23:21
    youngdave said...
    Sam
    * I have LEDs on P0 – P3, so changing the value of the Pin variable within this range is not a problem.

    The current situation is as follows.
    * The program FrequencySynth – Synth (using the external clock) compiles but doesn’t run.
    * The program Blinker1 – Output (not using the external clock) (from Spin Exercise 5-1 in the tutorial) compiles and runs.
    * This seems to indicate that compilation and calling of objects is not a problem, but that if the program requires the external clock, it won't produce any operation.
    * I wonder if the problem might be a dud crystal. Is this possible?

    * Timothy, you mentioned that the crystal may have become unseated. Do you mean by this that the crystal may simply need to be jiggled about in the connectors to make a clean connection, or something else?

    * Is the crystal just a standard 5MHz crystal available from any electronics supplier? If so I might buy one and try it.

    TIA David Young
    Dave,

    I suggest you try the program without the clock settings.....just comment the lines

    ·' _CLKMODE = XTAL1 + PLL16X
    ·' _XINFREQ = 5_000_000

    and see if the program runs....if it does then your problem is definately to do with the
    crystal....try to remove it and then putting it back in again.....

    Sam
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-06 23:23
    Sometimes the crystal works slightly loose in its socket during shipping. It's a standard 5MHz crystal with I think 20pf load capacitance. If the load capacitance is wrong, it will still work, but the frequency will be off slightly.

    If you can download programs from the Propeller Tool and they work as long as they run using the internal clock (RCFAST or RCSLOW), then you may have the "dreaded" PLL failure. This is a failure mode of the Propeller chip due to overvoltage stress on the chip, sometimes transient. The PLL selection logic seems to be the "weakest link" and fails first. The symptom is as mentioned. The boot loader uses the internal RCFAST clock which is also the default clock for compilations, so downloading works and some programs. Unfortunately, anything that's timing sensitive like serial I/O or display output won't work because the internal clock varies from chip to chip and is temperature sensitive.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-06 23:23
    The PropStick USB and the various Prop Proto Boards and demo kits use a socketed crystal. The leads on the crystal are cut short. In the PCB are tiny sockets. It is possible there may be a bad connection. Pull the crystal out and reinsert it or just press it down to make sure it is fully inserted.

    There is nothing special about the crystal. 5MHz, standard package of HC49/u (or something like that).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • youngdaveyoungdave Posts: 70
    edited 2009-08-07 04:36
    FrequencySynth – Synth runs when _CLKMODE = XTAL1 + PLL16X and _XINFREQ = 5_000_000 are commented out, but not when they are included in the compile.

    I purchased an 8MHz crystal. FrequencySynth – Synth runs when _CLKMODE = XTAL1 + PLL16X and _XINFREQ = 8_000_000 are commented out, but not when they are included in the compile.

    This "dreaded" PLL failure due to overvoltage stress on the chip is bad news! I’ve only ever supplied the chip with +5VDC from a power pack with a 0.47uF capacitor across +5VDC and GND just before P9 and P12.

    A comment from Parallax on replacement would be nice.

    TIA David Young
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-07 04:40
    Try the following:

    _CLKMODE = XTAL1 + PLL8X 
    _XINFREQ = 8_000_000
    
    



    This changes the PLL to 8x. With an 8MHz crystal, you can't run at 16x on the PLL because that is out of range for operating (128MHz.)

    Report back. If you suspect a problem, go ahead and call or e-mail Parallax Customer support and include the link to this thread.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • youngdaveyoungdave Posts: 70
    edited 2009-08-07 04:55
    Timothy
    I tried the following but it doesn't work.

    _CLKMODE = XTAL1 + PLL8X
    _XINFREQ = 8_000_000

    TIA David Young
  • SamMishalSamMishal Posts: 468
    edited 2009-08-07 05:21
    youngdave said...
    FrequencySynth – Synth runs when _CLKMODE = XTAL1 + PLL16X and _XINFREQ = 5_000_000 are commented out, but not when they are included in the compile.

    I purchased an 8MHz crystal. FrequencySynth – Synth runs when _CLKMODE = XTAL1 + PLL16X and _XINFREQ = 8_000_000 are commented out, but not when they are included in the compile.

    This "dreaded" PLL failure due to overvoltage stress on the chip is bad news! I’ve only ever supplied the chip with +5VDC from a power pack with a 0.47uF capacitor across +5VDC and GND just before P9 and P12.

    A comment from Parallax on replacement would be nice.

    TIA David Young
    If the program runs with the clock specs commented out then we now know that your trouble
    is with the clock system.

    If it is the PLL cicuitry then there is nothing you can do but·replace the chip.

    If it is just the crystal then you can try to replace the crystal.....but from your other postings
    that is not working then there is no other conclusion other than that the PLL circuitry is caput....

    Sorry......that is a bummer....maybe parallax can do something .... they are GREAT people I am sure
    they would help.....

    Sam
    ·
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-07 05:31
    Second what Sam says.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • youngdaveyoungdave Posts: 70
    edited 2009-08-07 05:32
    Sam
    Yes, I've just emailed Parallax support.
    Thanks for all the help from everyone.
    It's been a character-building experience.
    TIA David Young
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-07 05:46
    There are probably a few others things learned in the process as well. Things that will increase your knowledge of the Propeller. Forums are great source of help. So is the Propeller Data Sheet and the Propeller Manual.

    Let us know the results of your conversations with Parallax. They are reasonable and do the best customer support that I have experienced in electronics companies.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • youngdaveyoungdave Posts: 70
    edited 2009-08-07 06:06
    Yes, quite a lot of other things learned.
    I'll put the results of the conversation with Parallax on the forum.
    Thanks David Young
  • photomankcphotomankc Posts: 943
    edited 2009-08-07 18:16
    youngdave said...


    This "dreaded" PLL failure due to overvoltage stress on the chip is bad news! I’ve only ever supplied the chip with +5VDC from a power pack with a 0.47uF capacitor across +5VDC and GND just before P9 and P12.

    Are you running the chip on +5V to it's supply pins? Couldn't tell from that comment if you are taking about stepping down from 5 to 3.3 or you are running 5 right up to the chip.
  • youngdaveyoungdave Posts: 70
    edited 2009-08-07 19:24
    +5VDC right up to the chip.
Sign In or Register to comment.