(you are viewing a thread; or go back to
list of threads)
LDmicro.GitHub news v4.2.1 (by Ihor Nehrutsa)
https://github.com/LDmicro/LDmicro/releases/tag/4.2.1
== Release 4.2.1
* Fixed: The 'Help' and 'About' dialog boxes are displayed in the selected Color scheme.
* Fixed: Simulation of the GOTO and GOSUB instructions.
* Fixed: Pull-Up resistors in ATmega MCU and ANSIC code.
* Wiki: SUBPROG, RETURN, ENDSUB and GOSUB, LABEL and GOTO instruction. Part 2
https://github.com/LDmicro/LDm...L-and-GOTO-instruction.-Part-2
SUBPROG, RETURN, ENDSUB and GOSUB, LABEL and GOTO instruction. Part 3
https://github.com/LDmicro/LDm...L-and-GOTO-instruction.-Part-3
(no subject) (by MGP)
Thanks for the new version.
I was experimenting with the Delay(µs) function and I was suprised that the time was only given by numbers and not a variable.
I was trying to make servosignals (ppm) 1 to 2mS on 20ms timebase.
Is it difficult to change this?
(no subject) (by Ihor Nehrutsa)
manual.txt :
> DELAY 1 us
---[DELAY]---
The DELAY instruction causes a delay in us. DELAY instruction does not
use any timers/counters. The NOP and JMP(Current Address+1) instructions
are used to make delay.
See https://github.com/LDmicro/LDmicro/wiki/DELAY-us
Delay(µs) designed specifically for short times, less than 100 us. Although the parameter (µs) is not limited. Simply more NOP's and JMP+1 will written to hex during the LD compilation time ;)
1-2 mS is too big for the Delay(µs) instruction.
Delay(µs) not for your purposes in this case.
Use minimal PLC cycle time and TON, TOF, ....
(no subject) (by MGP)
Ok thanks you for the explanation.
(no subject) (by Alex)
thanks for the updates, could you add a simple example using pull-up resistors with ansi c.
I made a program using ansi c, i attach the program (ansic_example.c and ansic_example.h ), proteus simulation and ladder software.
(no subject) (by Alex)
i have some questions, i attach images to make it clear, i have noticed that one or some unused pins are high level using ansic code, that´s why i used "output_b(0)", this coomand initializes port b with low level, due to that, unsued pins are no longer in high level, but is this a good way to do that?
(no subject) (by Alex)
I used Pic C Complier 5
the other question is that if i want to use plc cycle time 0 as ldmicro does, in ansic is it correct just to call it using the smallest period of time pic c compiler can do with timer 1?
0.0016ms
image attach
(no subject) (by Alex)
by the way,in the ansi c example there are just 3 leds, the 4th one in the images (question.rar) is to show high level of unused pins
(no subject) (by Ihor Nehrutsa)
to Alex
PLC cycle time "0" is equivalent to picture
In fact, the duration of the PLC cycle
is unstable, variable and uncertain, undefined.
PLC cycle time depends of the сomplexity of the
PlcCycle() algorithm.
(no subject) (by Ihor Nehrutsa)
to Alex
You need an additional resistor RA0->GND.
(no subject) (by Ihor Nehrutsa)
to Alex
RTFM
After reset value of PORTB is unknown. May be 0, may be 0xFF.
Proteus fill it randomly.
(no subject) (by Alex)
Thanks for you reply, made it oe clear,yes, i´m reading the manual :(
(no subject) (by Alex)
*made it to me clear
(no subject) (by Ihor Nehrutsa)
to Alex
Set_trisb(~0x07) PBO-PB2 will outputs, PB3-PB7 will inputs
(no subject) (by bfwolf)
Hello Ihor ;-)
Congratulations and many thx for the new version!
Many improvements! ;-)
GOTO and GOSUB seem to be functional and very useful. :-)
I also noticed, that you now enabled the UART-code for ANSIC...
I have one sugggestion for this:
You include full support functions for the UART in the produced c-source-file, but these are only working for AVR chips
and the main() and setupPlc() functions are very simple or better stub-functions. OK, they allow the file to be compiled and self-hosted but limited to AVR.
How about making the functions switchable using #ifndef ? ;-)
Eg:
....
#ifndef EXTERN_UART_Transmit
void UART_Transmit(unsigned char data) // AVR
{...}
#endif
#ifndef EXTERN_UART_Receive
unsigned char UART_Receive(void) // AVR
{...}
#endif
....
#ifndef EXTERN_setupPlc
void setupPlc(void)
{...}
#ifndef EXTERN_main
int main(void)
{...}
#endif
Regards and many thanks! ;-)
(no subject) (by Alex)
Thanks a lot Ihor, now it works ok :)
(no subject) (by Alex)
image 2
(no subject) (by Alex)
wow uart for ansi c, i would like to test it on microship pic´s when avaliable
(no subject) (by Alex)
using this command (image attach) unused pins are ok too
(no subject) (by Alex)
i have a doubt, while compiling ansic in 4.2.1 i get a message (cmd) why is that?
(no subject) (by Ihor Nehrutsa)
Pay attension to the postcompile.bat.
I use it for small automatione of the routine.
After F5 Compile I call the C or ASM compiler and get another hex file, etc.
But you can delete postcompile.bat or change it as you wish
PIC18F4520 (by Antonio)
Hi Ihor!
Is possible to include the PIC18F4520 in the next version of
LDMICRO compiler?
This device is pinout compatible with pic16f877a... but more powerfull.
Thanks so much!
(no subject) (by Ihor Nehrutsa)
Perhaps on a fee basis.
Please contact [email protected]
Post a reply to this comment:
|