Go Down

Topic: PWM frequency library (Read 205248 times) previous topic - next topic

randumbhero

Does anyone know of a similar library that works with ATTINY45/85?  Anybody want to help me port this one over?

yatin

can we change mode of PWM to fast instead of phase corrected?( as we can get double resolution in fast mode)
Yatin
Hard work is only solution if you are not smart!!

DrJones

Having issues using this library, probably some annoying oversight but if anyone could help me get it to run it'd be great. Seems like the compiler is not getting the functions properly somehow..

Code: [Select]
void setup() {
#include <C:\Users\Jonas\Documents\Arduino\Fancontrol\PWM\PWM.h>

InitTimersSafe();
SetPinFrequency(1, 25000);

}

void loop() {

}


Error message:
Quote
C:\Users\Jonas\AppData\Local\Temp\ccWpBMvO.ltrans0.ltrans.o: In function `setup':

C:\Users\Jonas\Documents\Arduino\Fancontrol\main/main.ino:4: undefined reference to `InitTimersSafe()'

C:\Users\Jonas\Documents\Arduino\Fancontrol\main/main.ino:5: undefined reference to `SetPinFrequency(signed char, unsigned long)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

Lior_K

Hi,

I have problem to use this library. I'm using Arduino 1.8.1
I copy the PWM folder to the correct location as mentioned above
In the Library manager i get the following note: "PWM Version unknown INSTALLED"
What i did wrong?

Thx,
Lior


pert

Hi,

I have problem to use this library. I'm using Arduino 1.8.1
I copy the PWM folder to the correct location as mentioned above
In the Library manager i get the following note: "PWM Version unknown INSTALLED"
What i did wrong?

Thx,
Lior


I don't think your error has anything to do with this library. The "PWM Version unknown INSTALLED" entry you see in Library Manager just means you have the PWM library installed and it doesn't define the version. That doesn't indicate any problem and is exactly what would be expected after you install the library. The true error you are encountering is shown in the red text on the black console window at the bottom of the Arduino IDE window. I don't think that has anything to do with the PWM library. I just installed it and opened Library Manager in Arduino IDE 1.8.1 and didn't encounter that error.

When you encounter error messages you should always post them on the forum as text, using code tags (</> button on the toolbar). screenshots are almost never useful and will make it much less likely for you to get help here.

Lior_K

Hi,

Thanks for your reply. Sorry, I'm new Arduino user (-:
I assumed that it's the PWM library since the PWM function are not working while running the program
Could it be connect to the Java version on my PC?

The message that i get is:
Code: [Select]
[/
http://downloads.arduino.cc/packages/package_index.json file signature verification failed. File ignored.
java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onUpdatePressed$0(LibraryManagerUI.java:212)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at cc.arduino.contributions.libraries.LibrariesIndexer.rescanLibraries(LibrariesIndexer.java:114)
at cc.arduino.contributions.libraries.LibrariesIndexer.setLibrariesFolders(LibrariesIndexer.java:106)
at processing.app.BaseNoGui.onBoardOrPortChange(BaseNoGui.java:665)
at processing.app.Base.onBoardOrPortChange(Base.java:1295)
at processing.app.Base$12.actionPerformed(Base.java:1522)
at processing.app.Base.filterVisibilityOfSubsequentBoardMenus(Base.java:1561)
at processing.app.Base.access$000(Base.java:82)
at processing.app.Base$11.actionPerformed(Base.java:1494)
at processing.app.Base.rebuildBoardsMenu(Base.java:1472)
at processing.app.Base$8.onIndexesUpdated(Base.java:1327)
at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onUpdatePressed$0(LibraryManagerUI.java:210)
... 1 more
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at cc.arduino.contributions.libraries.LibrariesIndexer.rescanLibraries(LibrariesIndexer.java:114)
at cc.arduino.contributions.libraries.LibrariesIndexer.setLibrariesFolders(LibrariesIndexer.java:106)
at processing.app.BaseNoGui.onBoardOrPortChange(BaseNoGui.java:665)
at processing.app.Base.onBoardOrPortChange(Base.java:1295)
at processing.app.Base.openLibraryManager(Base.java:1346)
at processing.app.Base.lambda$rebuildImportMenu$2(Base.java:1060)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
]

Thanks,
Lior

pert

Thanks, that's much better to be able to read the full error output in text. That is quite strange. I don't think it's related to your Java version but I'm not sure of the cause. Do you get that error only when you do Sketch > Include library > Manage libraries or do you also get it when you're trying to compile or upload your sketch?

Lior_K

Hi,

it was while Sketch > Include library > Manage libraries.
the message that i got while compiling is too long to be send here but part of it is:

Code: [Select]
[/avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM9
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Wiring
         Description     : Wiring
         Programmer Model: AVRISP
         Hardware Version: 15
         Firmware Version Master : 2.10
         Vtarget         : 0.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: reading input file "C:\Users\KAYKOV~1.AUT\AppData\Local\Temp\arduino_build_56302/Testing_the_motor_driver_Using_Timer1_for_Generate_CLK.ino.hex"
avrdude: writing flash (4662 bytes):

Writing | ################################################## | 100% 0.78s

avrdude: 4662 bytes of flash written
avrdude: verifying flash memory against C:\Users\KAYKOV~1.AUT\AppData\Local\Temp\arduino_build_56302/Testing_the_motor_driver_Using_Timer1_for_Generate_CLK.ino.hex:
avrdude: load data flash data from input file C:\Users\KAYKOV~1.AUT\AppData\Local\Temp\arduino_build_56302/Testing_the_motor_driver_Using_Timer1_for_Generate_CLK.ino.hex:
avrdude: input file C:\Users\KAYKOV~1.AUT\AppData\Local\Temp\arduino_build_56302/Testing_the_motor_driver_Using_Timer1_for_Generate_CLK.ino.hex contains 4662 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.62s

avrdude: verifying ...
avrdude: 4662 bytes of flash verified

avrdude done.  Thank you.

http://downloads.arduino.cc/packages/package_index.json file signature verification failed. File ignored.]

pert

The output shows that the sketch has successfully compiled and uploaded. The error you're seeing:
Code: [Select]
http://downloads.arduino.cc/packages/package_index.json file signature verification failed. File ignored.]
will not cause any problems for compiling or uploading the sketch. If the code isn't working correctly that has nothing to do with that error. That error does indicate a problem with Boards Manager and possibly Library Manager this may cause you to be unable to use those features to get updatable boards/libraries notifications or install boards/libraries. Often it's possible to do those processes manually if needed so you may be able to just ignore that. I suspect it's some sort of a network issue. It's trying to verify the downloaded package index file and the verification is failing.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy