View previous topic :: View next topic |
Author |
Message |
zydis
Joined: 10 Aug 2015 Posts: 3
|
Making a Ladder Compiler for Pic |
Posted: Thu Jan 28, 2016 2:29 am |
|
|
Hi, I want to make ladder compiler for my university project. I will write a program that will convert ladder chart to hex file so I need machine programming map for pic18f67k22. Can you help me how can I find this type of documents? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Thu Jan 28, 2016 3:35 am |
|
|
If you are making a compiler, you are on the wrong forum. This is a forum for people _using_ the CCS compiler....
As a general comment, you type the machine code map in yourself, from the data sheet. Table 29-2. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Thu Jan 28, 2016 6:39 am |
|
|
I was curious about 'ladder compiler' and Googled it. Interesting.. a program to convert ladder logic pseudo code into a program a PIC can run. After a couple of coffees I've concluded it is possible to code an 'interpeter' inside the 67K22 and have it create the program.Similar to PICs with embedded BASIC or C in them. It is a HUGE project but broken down into sections like 'ladder data input', 'logic functions' ,'code programming' it is possible. After all some PLCs are buit this way. BTW there are several PIC based ladder logic programs out there.
Ironically I was asked to 'upgrade' a 30 year old 68705P3S product. Seems quartz windowed device DO have a limited lifespan! A PIC16F886 is way overkill and the cost to read the 68705 and convert to CCS C will probably kill the job. The hardware is cheap, the software R&D isn't.
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Thu Jan 28, 2016 8:05 am |
|
|
Yes. In fact if he has got the CCS compiler, the easiest way to do this, is to completely forget about the PIC code, but instead to use:
<http://ladder-logic-compiler.soft112.com/>
This produces a 'pseudo code', which could be very easily translated into C, which then becomes portable to multiple chips. Won't give the ultimate performance in some places, but could be done in just a few hours. The same pseudo code could be translated relatively easily into assembler, but this would be more work. |
|
|
|