C LMM, Serial?
davidsaunders
Posts: 1,559
As I am attempting to get the 3D printer firmware done completely in C in LMM code for the first version:
I still need to implement serial to get the G-Code from the host system, and send the OK's back to the host system.
So what are the limits of pseudo RS232 (to the FTDI prop loader) in LMM GCC, and is there any sample code for this???
I still need to implement serial to get the G-Code from the host system, and send the OK's back to the host system.
So what are the limits of pseudo RS232 (to the FTDI prop loader) in LMM GCC, and is there any sample code for this???
Comments
For the sake of comparing code size I created this Hello World example. It also shows you almost all the different ways to say "Hello world" in C/C++ on the Propeller.
I have found a lot of examples of the usage of FDSerial though without FDSerial it does no good.
I do thank you both.
It's assumed that you know how to write your own version
It should be in the simple libraries
There's a version of FDSerial in the standard libraries. doc/Library.html in the propgcc repository has a discussion of how to install drivers and how to force the use of FDSerial instead of simple serial. However, if your communication is half-duplex (you mentioned you receive the code, and send back an OK, so half duplex may be sufficient) then you can save a COG by using the simple serial driver. That's the default for the C library. You can open multiple channels by doing fopen("SSER:parameters", "r+") or the like; again, Library.doc has the details.
The full duplex serial code can be found in the Simple Libraries download from the C Learning tutorials. The link to the (very simple) fds tutorial with the link to the download can be found here:
http://learn.parallax.com/propeller-c-simple-protocols
Tom
#include "fdserial.h"
Within that same directory....
C:\Program Files\SimpleIDE\Workspace\Learn\Simple Libraries\TextDevices\libfdserial
You will also find fdserial.c
So that is another problem solved.