Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Arduino

(you are viewing a thread; or go back to list of threads)

Arduino (by Mario Zoletti)
Hello
Could you answer me if all instructions are accepted by Arduino. For example, I can't get the AD coverter instruction to act on the compare variable instructions. I'm using AVRDUDESS as a way to download the program on the Mega Arduino board.
Thankful.
Wed Jul 1 2020, 12:47:46, download attachment temp.hex.ld
Arduino (by DanielH)
@Mario:

I don't have an Arduino Mega to test your program on bare metal.

However, I suspect that .hex generated by LDmicro based in yourtemp.hex.ld program is faulty:

1. You have NOT assigned any pin for PWM out; LDmicro variable list complains, under in name column: PAtemp PWM Out <not an I/O!>

2. You can NOT assign 60 Hz as base frequency for PWM in Arduino.
Available PWM target (base) frequencies in ATmega 164/324/644/1284/2560 follow this formula:
fPWM = fclk_I/O / (n*256) where fcIk_I/O is the frequency of external or internal oscillator, and n can be 1, 8, 64, 128 or 256, see https://github.com/LDmicro/LDmicro/wiki/LDmicro-PWM and

Arduino Mega has a 16 MHz crystal, so available PWM target frequencies are 62500 , 7812, 976, 488 and 244 Hz, far away from 60 Hz.

I suggest you: assign a suitable pin for PAtemp PWM Out (double click on PAtemp variable, and select an available pin), change the target frequency to a allowed value, then compile again and test...
Sun Jul 5 2020, 20:32:13
(no subject) (by Mario Zoletti)

Hi Daniel.
Thank you for your answer about my doubt.
After a few adjustments I got a good result.
thank you very much
Tue Jul 7 2020, 18:10:41
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):