Author |
Message |
Topic: Why does my code keep restarting? |
teccs
Replies: 6
Views: 1856
|
Forum: BASCOM-AVR Posted: Fri Nov 03, 2023 1:48 am Subject: Finished Code? |
This is the code I have finished up with:
' ------------------------------------------------------------------
' 1. Title Block
' Author: Tim Chapman
' Date: 10 October 2023
' Versi ... |
Topic: Why does my code keep restarting? |
teccs
Replies: 6
Views: 1856
|
Forum: BASCOM-AVR Posted: Mon Oct 30, 2023 6:36 pm Subject: Reply |
The PCB is built with the same schematic as the Arduino Mega 2560. It uses a USB connector to program (and reset the ATMEGA 2560). To BASCOM, it looks like an Arduino Mega 2560.
The motors are of ... |
Topic: Why does my code keep restarting? |
teccs
Replies: 6
Views: 1856
|
Forum: BASCOM-AVR Posted: Mon Oct 30, 2023 3:01 am Subject: Why does my code keep restarting? |
When I run this code, it keeps restarting the microprocessor.
Any ideas why?
Thank you in advance!
ALSO
Why can't I reset the processor from the GUI in version 2.0.8.6? It works in version 2.0. ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Mon Mar 08, 2021 10:38 pm Subject: The Code from EDC works |
So, from there, I tried the code EDC posted above.
It works perfectly.
It reports frequency, not RPM.
RPM = Frequency * 30
So, an error of 1 Hz gives and RPM error of 30 RPM.
That is plenty close ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Mon Mar 08, 2021 10:35 pm Subject: Still working on the code from NWS |
I could not get this to work. Results are in attached spreadsheet.
There is a non-linear relationship between the actual RPM from the oscilloscope and the RPM reported by BASCOM.
' ------------ ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Sat Mar 06, 2021 6:33 am Subject: Resuming work on this |
Thank you all again for the replies.
I am going back to the beginning of everyone's comments and working on implementing them and seeing the results.
The suggestions from MWS are where I am starti ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Mon Mar 01, 2021 11:57 am Subject: laborratte |
Hello laborratte.
Thanks for the reply. I did change the use of Timer0 and Timer 1 around in the second posting of my code. I have not been able to find good material to read so that I can truly ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Mon Mar 01, 2021 5:37 am Subject: Results |
From the oscilloscope:
Min: 17.03 Hz = 510.9 RPM
Max: 17.33 Hz = 519.9 RPM
Average: 515.4 RPM
From the Arduino Nano:
Average: 518.58 RPM
Min: 505.6636
Max: 536.3272
' 1. Title Block
' A ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Mon Mar 01, 2021 5:00 am Subject: More accurate with the original code |
I changed back to the original code with the addition of SAVEALL on the ISRs.
I discarded the RPM readings that were double what normal would be.
I averaged the remaining RPM readings.
Oscillosco ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Mon Mar 01, 2021 4:17 am Subject: The latest |
Thank you everyone for the replies.
I changed the code to this:
... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Sat Feb 27, 2021 2:18 pm Subject: How to use Timer0 for 25 kHz PWM with 16 MHz Clock |
Hi O-Family,
I tried to get 25 kHz out of Timer0 but I could not get it to work.
Do you know how to do it? |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Sat Feb 27, 2021 1:28 pm Subject: Timer 1 is in use |
Hi Evert. Thank you for your reply. I could not figure out how to make one of the other timers do the PWM output at the required 25 kHz. If you have a way for me to free up Timer 1 that would be aw ... |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Sat Feb 27, 2021 10:27 am Subject: What is the solution? |
Do you know a way to solve the problem or do I need to use two arduinos to do this? |
Topic: Interrupt overflows being missed? |
teccs
Replies: 29
Views: 1822
|
Forum: BASCOM-AVR Posted: Sat Feb 27, 2021 10:16 am Subject: Interrupt overflows being missed? |
My code posted below is used to control the RPM of a fan and measure the RPM.
It controls the fan speed nicely, but doesn't read the fan speed reliably.
The actual fan RPM is 508 RPM with minor fl ... |
Topic: Representing ports numerically? |
teccs
Replies: 4
Views: 402
|
Forum: BASCOM-AVR Posted: Wed Apr 08, 2020 9:36 pm Subject: Thanks Albert. |
I will give this a try. |
|