Code Monkey home page Code Monkey logo

arduino-web-timers's People

Contributors

dbuezas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

arduino-web-timers's Issues

Windows-10 PC, Firefox browser , up/down slider for timer compare value not working

Let me start by saying ...Wow, wow and wow about the elegance of this tool. I think this will help a lot of people, also as a learning tool to grasp what timers actually do.
You asked for some feedback, and the only thing I found for now is that I can use Chrome or Opera as a browser to have the slider working. My Firefox browser won't let me use the slider for setting the OCRxA/B value(s).
This on a Windows10 PC.

Missing TCCRxA = 0 in Normal Mode

I used this configuration.
)

/**
  * URL: https://dbuezas.github.io/arduino-web-timers/#mcu=ATMEGA328P&timer=2&interruptA=on&OCR2A=50&interruptB=on&OCR2B=150&InterruptOnTimerOverflow=on&timerMode=Normal&clockPrescalerOrSource=128&FCPU_UI=8Mhz
  * Mode     : Normal
  * Period   : 2.048 ms
  * Frequency: 488.28125 Hz
  * Outputs  : none
  */
void setup(){
  noInterrupts();
  TCCR2B = 
    1 << CS22;
  TIMSK2 = 
    1 << OCIE2B |
    1 << OCIE2A |
    1 << TOIE2;
  OCR2A = 50;
  OCR2B = 150;
  interrupts();
}

Somehow on my controller, TCCR2A was set to 1 but it should be 0.
I added TCCR2A = 0; to the code and it works fine now.

Maybe add TCCR2A = 0; in normal mode?

Output port switching code seems wrong in some cases.

After you (@dbuezas) mentioned your Arduino Web Timers App, I tested it with Firefox. The result is here:

Timer 1:
kép
I'm not tested, but in my opinion the correct program code would be:

  PMX0 = 
    1 << WCE;
  PMX0 = 
    1 << C1BF4;

Like setting of the clock prescaler register WCE meaning: update enable then update.
PMX0/1update: Must write logic one to WCE. In the following 6 system clocks PMX0/1 update will be finished by writing the register.


Timer 2:
kép
In my opinion the correct program code would be:

  PMX0 = 
    1 << WCE;
  PMX1 = 
    1 << C2BF7;

Timer 0, no port switching code:
kép


Timer 3 looks good code:
kép

timer0 any output on toggle mode

always with lgt8f328p with 1.0.6 and arduino ide 1.8.15
I have try the timer 0 on normal mode with toggle ..no toggle but never have an output ??? i have block the normal loop to avoid arduino core to use timer0 because i was thinking this block the direct use of timer0 but same things.
This work with timer3..

void setup(){

/* https://dbuezas.github.io/arduino-web-timers/#mcu=LGT8F328P&timer=0&CompareOutputModeA=toggle&OCR0A=51&CompareOutputModeB=toggle&OCR0B=102 */

//timer0 test
TCCR0A =
1 << COM0A1 |
1 << COM0B1;
TCCR0B =
1 << CS00;
OCR0A = 128;
OCR0B = 102;
//or others settings
//timer0 test
// TCCR0A =
// 1 << COM0A1 |
// 1 << COM0B1;
// TCCR0B =
// 1 << OC0AS |
// 1 << CS00;
// PMX0 =
// 1 << WCE |
// 1 << C0BF3;
// OCR0A = 51;
// OCR0B = 102;

//timer0 test
// TCCR0A =
// 1 << COM0A1 |
// 1 << COM0B1 |
// 1 << WGM01;
// TCCR0B =
// 1 << OC0AS |
// 1 << CS00;
// PMX0 =
// 1 << WCE |
// 1 << C0BF3;
// OCR0A = 51;
// OCR0B = 20;

//timers3 test work

//TCCR1A =
// 1 << COM1A0 |
// 1 << COM1B0;
// TCCR1B =
// 1 << CS10;
// OCR1A = 13107;
// OCR1B = 26214;

pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(A0, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A3, OUTPUT);

interrupts();
}

int main( void )
{

setup();
// Your code goes here
while (true) {};
}

void loop() {
// put your main code here, to run repeatedly:

}

Hash based deep linking needs rework

It is a bit hacky and not performant.

Idea:

  • Use debounce {leading: false, trailing: true} to set the full hash
  • Don't react to hash changes unless they are truly different than the current state
  • Never set the hash directly (e.g to set defaults or to change timer index or mcu). Instead add the defaults internally when reading the hash. This makes the defaults implicit.
  • Get rid of userConfigState_internal

Definition of Clock Control Status Register

Hi,

many thanks for your very helpful work!
It's also a very good tool to train somebody.

Within arduiono-web-timers scripts, the definition of the Clock Control Status Register is 'TCKSCR'.
Within your lgt8fx arduino board package it is 'TCKCSR'.

I agree, the definition in the data sheet is confusing ;)

Gruß
Jörg

Timer2 isuue

Hello! Thanks for your software...
In Normal Mode (ATmEga328P), when select TOGGLE on OCA/B the code are

TCCR2A =
1 << COM2A1 |
1 << COM2B1;
TCCR2B =
1 << CS22 |
1 << CS21 |
1 << CS20;
But must be 1 << COM2A0 |
1 << COM2B0;
Best regards...

Adding a Frequency source setting

This will very good to add an input for set the frequency source of timer that the graph use to displays the event and to have the timing on the graphic scale numbers to be able to see the timming event like
the "real world" case of the board... 16Mhz board..8mhz... or for some special case with some quartz with special frequencies very very less usual but sometime very interesting to have the microcontrollers to "BPM" exactly to this special frequencies...
So if done many time will be win with web timer to have the goods settings to have the timer good real life timing found...

TC0 dead time register issue

When I played with arduino-web-timers, I noticed the Timer 0 dead time can only be adjusted to maximum 15. I looked out why.
So I noticed the generated code has a bug.

  TCCR0A = 
    1 << COM0A1 |
    1 << COM0B1 |
    1 << WGM00;
  TCCR0B = 
    1 << DTEN0 |
    1 << CS00;
  DDRD = 
    1 << DDD5 |
    1 << DDD6;
  OCR0A = 59;
  OCR0B = 110;
  DTR0L = 11;   <-- There are no independent DTR0L and DRT0H registers
  DTR0H = 9;

DTR0 = (9 << 4 | 11) is (9 * 16 + 11) is (155)

I think the correct setting of the Timer 0 DTR0 register for the example above is:
DTR0 = 155;

https://dbuezas.github.io/arduino-web-timers/#mcu=LGT8F328P&timer=0&DeadTime=on&DTR0H=9&DTR0L=11&OCR0B=110&OCR0A=59

Error compiling code on Arduino IDE when using Dead time on timer 3

Hello many thanks for this wonderfull timer configurator.
I do some try.
The pinout is quiet difficult to find the real pin .. perhaps add arduino pin number or physical of lgt qfp48 and 32 ???

I have want to put Dead time on timer 3 with pcpwm mode but at build time
this report not valid in this scope...

I have try same setting for timer 3 with FPWM mode this build ok.

My device is wavgat avga328p clone minipro.
Have a nice day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.