Skip to content

HOW TO: Integrate LDmicro and AVR Studio or PIC MPLAB software

LDmicroGitHub edited this page Jan 27, 2017 · 5 revisions

Now LDmicro can generate fully functional ASM code.
For example,
open asm_demo.ld in LDmicro,
simulate with ADC slider (to change ADCvalue and PWMduty and state of TEMP_HI pin) and
UART terminal input (to change "saved" vaiable). Press XLED, XPWM buttons and see outputs Coils/pins.
image
Then select menu -> Compile -> HEX->ASM.
image
LDmicro generate asm file for PIC or AVR:

  • asm_demo.asm - Do not edit this file, he is replaced in every compiling!

Then, open asm_demo.asm in Atmel/AVR Studio (for AVR's MCU) and Compile and Upload to the target Board.
image
or in MPLAB (for PIC's MCU) software and Compile and Upload to the Board.
image

Connect MCU UART to COMn on your PC and look at HyperTerminal,
press keyboard in HyperTerminal for change EEPROM 'saved' variable,
change the analog ADC input and see the output of the PWM signal.
Level of analog signal changes the PWM duty cycle. Memo: At the time of this writing, PWM sets only once after reset.
image Inputs, outputs, ADC, PWM, EEPROM, UART are working.

asm_demo.zip Tested at ATmega8.
Tested at ATmega328p on the Arduino Nano.

Addition 1. Arduino Mega 2560 (ATMega2560 based), tested in Proteus v7.
asm_demo_mega2560 asm_demo_mega2560.zip
It contains LD, asm, hex, Proteus7 model.

Addition 2. ATmega32U4, tested in Proteus.
asm_demo_atmega32u4
LD, asm, hex, Proteus v8.5 model asm_demo_ATmega32U4.zip

Send you own ld file to LDmicro.GitHub@gmail.com and receive asm file.

Clone this wiki locally