Search results

1. KISS problem setting Millis timed pulses during ON time

hi I think i almost have the code fixed for 1000 mseconds OFF, then 52ms x 10 pulses on and off with a 2ms shift between two channels. previous post shows the graphs and the way i understood it from pauls drawings. programming for me was not that straightforward. I accidently stumbled over...
2. KISS problem setting Millis timed pulses during ON time

hi, for using two signals i splitted up the FSM in two FSM which respresent their own channel. the first channel 0 is Clockwise as can been seen in post 36. the following attached signal Channel 1 represents during the OFF State of Channel 0 = Channel 1, but with two extra states States 1 and...
3. KISS problem setting Millis timed pulses during ON time

Hi Paul i took the weekend off, to get my head free. Thanks thanks a lot, so i wrote a simple program for one Output to start with. i am still confused how the FSM is handling the pulses because just counting up 1 2 3 makes more sense. i think this has to do with the FSM that it has to...
4. KISS problem setting Millis timed pulses during ON time

Hi i am trying to drive the direction of the current with the VNH5019 over the OUTPUT Pins 2,3 from my teensy4.1 sorry for the shadow on the pictures: Correct. Your system is different than Paul's DEMO of a single output cycling at two different rates. YES Question: so if i draw the...
5. KISS problem setting Millis timed pulses during ON time

Paul, Many thanks for your time, understanding, and your explanations. Really appreciated! The state machine: I only worked with small examples till now. Also including simple if statements. I was confused because one of the posts, there was a suggestion that I should reduce the number of...
6. KISS problem setting Millis timed pulses during ON time

good morning, i played a bit with the ElapsedMillis(); so far i got two signals that are shifted please see pictures: but the pulse train stops after a period of time of 1 second and doesnt repeat. i removed the functionRepetition_Polarity_Change_Emag() and used if else statements after...
7. KISS problem setting Millis timed pulses during ON time

good morning, i played a bit with the ElapsedMillis(); so far i got two signals that are shifted please see pictures: but the pulse train stops after a period of time of 1 second and doesnt repeat. i removed the functionRepetition_Polarity_Change_Emag() and used if else statements...
8. KISS problem setting Millis timed pulses during ON time

ok so i have CODE1 that does the following. creates a pulse of 400us within a total time of 10ms. the second pulse is 800us long and has the same Totaltime of 10ms over and over. for a Electromagnet project i would like to control the OFF Time ON Time Polarity change(i left this part out...
9. KISS problem setting Millis timed pulses during ON time

many thanks for that Paul, and preseverance in helping me out. really appreciated.
10. KISS problem setting Millis timed pulses during ON time

Ok interesting. Ill try a bit with an easy example and a else if statement Or is better to use booleans to see if an if statement is run? And make a same check as the independent on off?
11. KISS problem setting Millis timed pulses during ON time

thanks Paul, ill do that. ill remove the holdcount part ill start over and add some pictures. shows the following code: WORKS without Independent ON OFF int VNH5019 = LOW; unsigned long Timestamp = 10; //10ms per division int PulseWidth = 2; //variable for setting the pulse int...
12. KISS problem setting Millis timed pulses during ON time

so i am a bit further if i run this program, i can create pulsewidth and TimeStamp. during this time stamp the pulsewidth of INA will be high for x micros. INB will be shifted with 400us and is inverted. this works now. //CODE 1 const int INA_Clockwise = 0; const int INB_AntiClockwise = 1...
13. KISS problem setting Millis timed pulses during ON time

so i am a bit further if i run this program, i can create pulsewidth and TimeStamp. during this time stamp the pulsewidth of INA will be high for x micros. INB will be shifted with 400us and is inverted. this works now. //CODE 1 const int INA_Clockwise = 2; const int INB_AntiClockwise = 3...
14. KISS problem setting Millis timed pulses during ON time

would rather use this with millis. I’ll stick with that, I have a few function calls with SPI, currentsense encoder and TFTScreen in the background. I think this is a better start. For the INA pin. I’ll leave INB zero for now. Setting specific digital pulsewidth first with a 200us delay. And...
15. KISS problem setting Millis timed pulses during ON time

Hi Defragster, now its my turn, i didnt understand a thing you just told me, no offense. never worked with ISR, had it in my studies but never worked with it. no clue what speeling is. il elaborate:D ill go through the steps: the second assignment should only work during the ON Time of the...
16. KISS problem setting Millis timed pulses during ON time

of course i can tune them indepedent from each other but its a bit trickier, i have to set the On and OFF Time very low... any suggestions? int ledPin13 = 13; // the number of the LED pin int ledState13 = LOW; // ledState used to set the LED unsigned long previousMillis = 0...
17. KISS problem setting Millis timed pulses during ON time

i thought combining the two independent millis into one would be proof much usefuller, why is it only reacting to the first If statement in the void loop? why cant i control the OnTimePulseClock and OffTimePulseClock? but somehow only the first If statement in the void loop is accessed but the...
18. KISS problem setting Millis timed pulses during ON time

#define ENCODER_OPTIMIZE_INTERRUPTS #include <SPI.h> #include <elapsedMillis.h> #include <ButtonEvents.h> #include <Encoder.h> // digital IO pins. #define C_BLACK 0x0000 #define C_BLUE 0x001F #define C_RED 0xF800 #define C_GREEN 0x07E0 #define C_CYAN 0x07FF...
19. KISS problem setting Millis timed pulses during ON time

Good morning, So as to speak I’ll try this with elapsedmillis, I have more going on in my code. How do I check that the ONTime from the bald engineer link isn’t passed? int setToggleTime=500; elapsedmillis=Timetoggle; Int OnTime=2000;// from previous function. Needs to check condition of the...
20. KISS problem setting Millis timed pulses during ON time

Didn’t had any luck today running this kind of code inside an independent on off function Somehow I am misreading my signals from the teensy4.1. I’ll try it first thing in the morning!
21. KISS problem setting Millis timed pulses during ON time

I have one of those days that something is so simple, You can’t get your head around it. Simple Toggle Void setup() { pinMode(13,OUTPUT);//led during On Time pinMode(0,OUTPUT); pinMode(1,OUTPUT); } Void loop() { // probably I’ll have to set the condition of the pin =0; because the compiler...
22. Call function independent on off switch and repeat for loop

Int independent_On_Off() { if ((ON_VNH5019 == HIGH) && (ElapsedOFF >= OFFTime1)) //OFFTime first { ON_VNH5019 = LOW; // ElapsedOFF=ElapsedOFF-OFFTime1; //switch off the VNH5019 digitalWrite(INA,LOW); digitalWrite(INB,LOW);//break mode...
23. Menu and encoder handling how?

Hello guys, i am currently trying some stuff, i am using the st7735 with a teensy3.2 and encoder from Sparkfun. i am using the buttonEvent to scroll down and up(double click in the menu). there are two questions i have. i would like to see the value of the encoder first on the screen by...
24. Simple Countdown, but something is amiss.

hi silverlock, had some other stuff to do. id expect that it would countdown from 3,2,1,0. but then it goes to 6:28:15. unsigned long Days = 0; unsigned long Hours = 0; unsigned long Min = 0; unsigned long Sec_add = 3; unsigned long DisplaySec; unsigned long DisplayMin; unsigned...
25. Simple Countdown, but something is amiss.

so i tried the stuff you recommended. Int long Days = 0; Int long Hours = 0; Int long Min = 0; Int long Sec_add = 3; i get 6:28:00 and it starts counting down. Int long Days = 0; Int long Hours = 0; Int long Min =1; Int long Sec_add = 3; it starts...
26. Simple Countdown, but something is amiss.

Ok , ill write you tomorrow evening.
27. Simple Countdown, but something is amiss.

Probably a warning, no error, program runs. I’ll switch the if statement so that the condition is changed. still I think the problem is here? DisplaySec=Sec%60;
28. Simple Countdown, but something is amiss.

i changed it to if (millis() - startTime >= oneSecond) { Sec--; startTime += oneSecond; if (Sec >= 0) { DisplayDays = Sec / 86400; DisplayHours = Sec / 3600; DisplayMin = Sec / 60; DisplaySec = Sec % 60; }...
29. Simple Countdown, but something is amiss.

i think i know the problem where it occurs, its the sec =sec+ part that adds extra seconds to the loop and thus creates a mismatch.
30. Simple Countdown, but something is amiss.

hi guys, i am trying to build a simple countdown with a teensy3.2 with the millis function: but somehow the code is not responding properly could you see where the problem is? the code runs fine if the days is set to 1, but if i put all the values to Zero i get 6:28:9 and then it starts to...
31. difference between teensy3.6 and Teensy4.1 SPI configuration

it works thanks a million!
32. difference between teensy3.6 and Teensy4.1 SPI configuration

so i changed the max31855 cpp and h file, as suggested on github. still getting zero values, and no errors. i tried adding the spi.begin(); but that didnt do anything as well. i restarted the arduino and the teensyarduino bootloader just in case. ill try soldering tomrrow another max31855 in...

34. difference between teensy3.6 and Teensy4.1 SPI configuration

thanks for the fast reply Kurt! i dont have a clue what the SPIClass *theSPI = &SPI means and the implementation Adafruit_MAX31855::Adafruit_MAX31855(int8_t _cs, SPIClass *theSPI) : spi_dev(_cs, 1000000, SPI_BITORDER_MSBFIRST, SPI_MODE0, theSPI) {} i had this code running on the teensy3.6...
35. difference between teensy3.6 and Teensy4.1 SPI configuration

i also added into the void Setup the: SPI.begin(); SPI1.setSCK(27); SPI1.setMISO(39); SPI1.begin(); do I also have to set something like the CS to SPI1.setCS(36)? i am now getting pulses on the SCK2 (pin 27) that look like a train of pulses i added a 100ohm resistor in series with...
36. difference between teensy3.6 and Teensy4.1 SPI configuration

Hi group, good morning, I solved the part that the tft screen is working again. now to the real problem. i cant get the code working on a teensy4.1, it worked before on a teensy3.6, its probably a simple question. why is the Thermocouple not recognized. it doesnt show an error. also not...
37. Changes to SPI ?

Hello, I re-did my circuit board. and it worked before together with a featherwing 3.5, but I am getting Zero readings from my 4 thermocouples. Max31855 type K, SPI1 I used two seperate SPI lines on the teensy4.1 pin 27 for the CLK1and MISO1 on 39 all 4 max31855 Are connected together on this...
38. SPI spi1 pins work around

I tried that but the SPI devices stopped working. I’ll try tomrrow again Thanx For the reply!
39. SPI spi1 pins work around

Hi I re arranged In my previous post the pins to SPI1 and the default SPI. For the max31855 and it works. I know you can set the SPI1.setSCK(27) to pin 27 but why isn’t this pin used for SPI default. Because the pin 13 SCK is on the other side of the board, which will require you to pass a...
40. Sn74hc125 tristate required for between each SPI device? And how do you check this?

Hi, I use 4.7 k resistors pull-ups on my CS pins of the max31855. I used on the hx8357 featherwing 3.5 inch also a 4.7k on the CS to vcc. I had to remove that, because the scope images show not a max pull to gnd if CS was pulled low. If I didn’t use the serial monitor, I could check on the bus...
41. Sn74hc125 tristate required for between each SPI device? And how do you check this?

Hi guys, I still haven’t solved the problem yet, and have been googling the problem with the max31855 and other devices on the same SPI. All show similar problems with clearly Mosi problems and hard CS pin select detection. Still I was wondering if something like this could be solved by...
42. rewriting the functions to closed void functions

I also tried the following to understand it better so that I can see if it is run in consecutive order: by removing the Private function in the max31855 will allow me to talk to the spi_dev.read(buf,4); and use SPIread32. I removed in the Void Setup the TH1.begin() to see if there is a fault...
43. rewriting the functions to closed void functions

hi Kurt, i removed for the fun all of the code referring to the TH1.begin(); and I am not initializing anything. #include <SPI.h> #include "Adafruit_MAX31855.h" #include "HX8357_t3n.h" //#include <FlickerFreePrint.h>// library to draw w/o flicker #include <math.h> #include <stdio.h> #include...
44. rewriting the functions to closed void functions

Thanks Kurt, I feel like a toddler. Suppose that is true, how would you explain if the part from the max31855 in setup is written above tft.begin(); because then the values Zero show up, and the max isn’t working but the tft does I clearly get zeros on the display but no temperatures. I’ll...
45. rewriting the functions to closed void functions

Same as void loop principle with timing This means I have to repeat what I did at the void loop kind of the same....?
46. rewriting the functions to closed void functions

commented out the initialiser for the max31855, your program works, display shows val Hi Kurt, first the things I tried: I updated the library for the MAX31855 the error is gone, still no data on the screen. I tried also using a other MAX31855 from Rob Tillaart the MAX31855_RT. I used the...
47. rewriting the functions to closed void functions

Ok I’ll update the library. Just came across Adafruit tech forum. i clearly don’t understand the State machine. it has to be smaller then <=50;