Trying to get a picoplc compiled spin program to work with Quickstart
skylight
Posts: 1,915
Hi there, I have generated a spin file through picoplc and am trying to light up a led on the quickstart. The spin file is attached and I wondered if someone would be kind enough to look it over, as far as i'm concerned the quickstart should be lighting up one of the leds for approx 5 seconds but I am having no luck lighting up any leds.
the con statement uses 22 which should be one of the leds (P22) or am I confused about the pins/ports?
timerled.spin
the con statement uses 22 which should be one of the leds (P22) or am I confused about the pins/ports?
timerled.spin
Comments
I'm now wondering whether picoplc is compatible with the quickstart, the ladder side works fine in simulation it seems that the generated spin code is at fault.
I think that's why you don't find it anymore on the Net, only on some Prop-users harddisks.
PicoPLC was a fork of LDmicro which seems to work well, but has no direct Prop support. But LDmicro allows to output an "Interpretable bytecode". I have once made an interpreter in Spin for that bytecode, which also had some extensions.
If there is enough interest I will search it on my harddisk, maybe I can also add the QuickStart buttons as logic inputs.
This ladder logic questions come every half year here in the forum, but the interest is normally net very high.
Link to LDmicro: http://cq.cx/ladder.pl
Andy
Many thanks with all your help with this.
skylight
almost any spincode can run on any propeller-board. Expessially just sensing inputs for high/low and switching outputs on/off
will work with any propeller-chip-board
or
will not work with any propeller-chip-board
commands like
DirA[5] := 1
OutA[5] := 0
etc. etc. will work exactly the same way on any board.
Differences in behaviour may come from additional hardware like resistors that are soldered on the board or connected in an other way
I took a look into the schematic of the quickstart-board. nothing connected to IO-Pins 8-15
LEDs connected on pin 16-23,
Touchpads and resistors on pin 0-7
USB-to-serial-interfacechip on IO-pins 30,31 and EEPROM on 28,29
This means IO-Pins 8-15 are completely free and work exactly the same way as IO-pins on a PPDB, Protoboard, propboard-USB, propstick USB, Propeller-board of Education.
toggling IO-pins 8-15 with the LEDs will make the LED blink.
Again any differences in behaviour will come from hardware that has a fixed connection to IO-pins like LEDs or DAC-resistors.
As I wrote in the general forum thread picoPLC creates two bugs
attached to this posting there is the corrected picoPLC-code to make LED on P17 blink endlessly and the correlating picoPLC-file
Edit: oldest programmers wisdom I've ever heard:
Your code does ALWAYS EXACTLY what you have coded.
If your code does something else than you expected it to do
you don't exactly understand what you have coded.
for ARM-processors etc. there are several bugs in th processor itself.
So for those processors there are certain exceptions that confirm the rules.
Inside the propeller-chip since 2006 when the propeller-chip was born not a single bug inside the propellerchip was found.
The only thing that was ever found is a high special usage of a PASM-command
that has not a bug but a somehow unexpected behaviour which was well explained by Chip Gracey himself
so the behaviour of the propeller-chip is completely predictable and regularly.
best regards
Stefan
I learned it as "Your code does what you tell it to do, not what you want it to do"...
Same here! Most frustrating. I would much prefer if it was the other way around.