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 - Tutorial-Prog works, selfmade not?!

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

Tutorial-Prog works, selfmade not?! (by Reto)

Hi everybody

I have a strange problem:

When I download the example ("ldtut.ld") and compile, convert (.hex to .srec) and download it, it works fine. If I write my own program or even if I change something (e.g. a new rung) compile, convert and download - nothing works (it seams the controller resets a few times per second)???!!

I'm working with a ATMega32 40-pin at 8.00MHz.

Does anybody had the same problem?

I hope someone can help, as I try to built up a industrial-electronic course with the fantastic ldmicro in Eritrea - and we already built the hardware....

Greetings and thanks

reto
Mon Nov 4 2019, 04:35:32
Tutorial-Prog funciona, ¿hecho a sí mismo no? (por Reto) (by Paulino)
Attach your program and I will prove it to you

adjunta tu programa y te lo probare
Mon Nov 4 2019, 14:34:55
Prog-Files (by Reto)

Hi I packed the Files in a .zip.

Original file from tutorial (works):

- ldtut.ld
- tut.srec (with "srec_cat" converted file)

Modified file (I added just a new rung):

- ldtut3.ld
- tut3.srec (again convertrd with "srec_cat")

If you want the .hex file just tell me.

Thanks a lot for helping me!!!!

reto
Mon Nov 4 2019, 15:26:22, download attachment Send_to_ldmicro_forum.zip
Prog-Files (por Reto) (by Paulino)
Fill in the counter (Cstate), Type of input you can only place the Next Signs or (note is not a 0 is a consonant), sign - and the / bar.
I would like this way to say if it worked for you.

Rellena bien el contador (Cstate), Tipo de entrada solo puedes colocar los Signos Siguiente o (nota no es un 0 es una consonante), signo - y la barra / .
Me gustaría que por esta misma via dijera si te funciono.
Tue Nov 5 2019, 05:00:06
not clear (by Reto)
Hi Paulino

I don't understand your answer, sorry.

The first program (ldtut.ld) is from the tutorial on the ldmicro-webpage and it works!

The second one (ldtut3.ld) is the same, I just add a rung - and it doesn't work.
Even if I built a easy program with just one rung - Input direct to output (simulation works), it doesn't work on the ATMega32?!?!

reto
Tue Nov 5 2019, 14:40:22
(no subject) (by Ziggy)
There is an issue with ATmega32
Look into the JTAG interface and disable it.

I seem to recall in default state the JTAG interface is factory enabled so in order to use those pins dedicated to the interface YOU MUST TURN JTAG OFF
Tue Nov 5 2019, 14:53:20
(no subject) (by José)
Hi,

I have tested ldtut3.ld on a true ATMega16 programmed with JTAG interface, ans it worked fine...

Except memory size there are very few differences between AtMega16 and AtMega32:
http://ww1.microchip.com/downloads/en/AppNotes/doc2538.pdf

And theses differences are not relevant here.

So, I don't understand why it shoulnd't work as well on AtMega32...

JG
Wed Nov 6 2019, 03:56:56
(no subject) (by Ziggy)
Jose,

While it may work on ATmega16, it might appear NOT to work on ATmega32 depending on JTAG pin assignment.
As simple as that. A trap for the young and not so young player ( I count myself in the later kind ).
Wed Nov 6 2019, 04:03:57
(no subject) (by Paulino)
Ok here you have your program modified this works.
Look at yours with this one on the counter and you go the modification; admitted signs: -, o, /, you should know every sign that is what the programs do, I simulate it and see if it works.
please tell me if it works for you

Ok aquí tienes tu programa modifico este funciona.
mira el tuyo con este en el contador y vas la modificación;
signos admitidos: -, o, /, deves saber cada signo que es lo que hace n los programas, yo lo simulo y se ve si funciona.
Wed Nov 6 2019, 08:38:04, download attachment ldtut3Verificado.ld
(no subject) (by Paulino)
debes usar v5.3.1.0, https://github.com/LDmicro/LDmicro/releases.

I try what you say works for you and it really doesn't work, if it works if I check the Cstate -, o it works, - it also works, but if I put it / the backslash does not work,
This is what happens to you.

yo pruebo la que dices que te funciona y realmente no funciona, si funciona si verifico el Cstate Colocando, o funciona, colocando - también funciona, pero si le coloco / la barra invertida no funciona,
es esto lo que te ocurre.
Wed Nov 6 2019, 08:52:30
(no subject) (by Paulino)
Try this software, the Xbutton can not be fixed since the bounces affect you should make a franc for when you pass each lap or pulse.
I really don't know what you want to achieve.
but I think I understand that every time you give a pulse, Activate Cstate, in 1 and 2, if it has a 1, the output remains fixed, and if it has a 2, the output triggers according to the Tosc time.
it is right. I enclose this one that has raised the time for you to see when you simulate it.

Prueba este software, el Xbutton no puedes hacer fijo ya que los rebotes te afectan se debe hacer un franco para cuando pasa cada vuelta o pulso.
la verdad no se que quieres conseguir.
pero creo entender que cada vez que des un pulso se Active Cstate, en 1 y 2, si tiene un 1 se queda fija la salida, y si tiene un 2 la salida dispara según el tiempo Tosc.
es correcto. te adjunto este que le e subido el tiempo para que lo veas cuando lo simules.
Wed Nov 6 2019, 09:07:36, download attachment ldtut.verificado.ld
(no subject) (by José)
Hi

To Ziggy:

As far as I know, JTAG pin assignment is the same on both AtMega16 and 32...
But there can be a pb with Atmega32 anyway. I don't have this target to test it in hardware.

PS: I'm also of the latter kind !

To Paulino:

I don't understand your explaination, and if / how it solves the problem ?

Best regards
JG
Wed Nov 6 2019, 16:20:13
(no subject) (by Ziggy)
Jose, problem is if the chip is programed with ISP interface then the JTAG pins may remain dedicated to JTAG making them inaccesible by the program.SO if by some chance JTAG pins are used by the program... they will be inactive in the context of the program IO pins.

The user if unaware of this will claim a problem with the progeam rather than a hardware issue.
Wed Nov 6 2019, 22:08:04
(sin tema) (por José) (by Paulino)
In the counter window, 1st Name: new, Start Value: 0, Maximum Value: 9, Entry Type: (this is where one of the signs is placed, o, -, /,).
Fri Nov 8 2019, 04:23:50
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):