- Parallax Propeller Projects
- Parallax Propeller Activity Board
- Parallax Propeller C
- Parallax Propeller Reading From A Serial Port Numbers
- Parallax Propeller Reading From A Serial Portal
I've been trying for a couple days now to figure out how to read anything useful off the RS 232 on the Propeller Professional Development Board. I have messed around with FullDuplex and all that from the Fundamentals book to no avail.
My goal is to get a signal from my Spaceball 5000 (It is a 3D motion controller similar to http://www.3dconnexion.com/·) so I can hook the signal probably first to my oscilloscope to hack it. Once I know what binary stuff I get when I manipulate the Spaceball I can try to get it to be read by the Propeller and use it to move servos or god knows what.
I also have multimeters that can connect to my computer and make real handy spreadsheet data etc. This would also be great to be able to use on Propeller.
The problem is I have no idea how to even get a signal. I realise RX will be sending data to the Prop, and that my devices probably need a clock type signal through CTS. I can get this to communicate fine to my laptop through that debug window. I get the idea of pushing buttons to control the debug or input numbers to have it converted and that sort of stuff. The problem is using the MAX3232E thing to interface at all between the Prop and my devices plugged to the RS 232.
Does anyone have any links or advice? I am very new to Propeller so please explain in detail if you can.
This Spaceball, as well as the Multimeters, do have Drivers that must be installed for Windows to properly interact with the devices. I am going off the assumption that these devices are simple things that send out pulses indicating their status after getting a 'Send me Data' signal, which probably goes through CTS. I assume any power, as far as VSS VDD, is provided by the jack I've been talking about in the bottom left corner of the PPDB.
Thanks for any help. Please remember I am very new to this specific Language and Chip. I can program TI calculators a bit in Basic, that is the extent of my programming knowledge, besides monkey see monkey do in BS2. As far as the electronics part the toughest thing I've done is make a spark gap with a 555 and ignition coil without any directions. Just to give you an idea of my programming and electronics knowledge (or lack thereof).
My goal is to get a signal from my Spaceball 5000 (It is a 3D motion controller similar to http://www.3dconnexion.com/·) so I can hook the signal probably first to my oscilloscope to hack it. Once I know what binary stuff I get when I manipulate the Spaceball I can try to get it to be read by the Propeller and use it to move servos or god knows what.
I also have multimeters that can connect to my computer and make real handy spreadsheet data etc. This would also be great to be able to use on Propeller.
The problem is I have no idea how to even get a signal. I realise RX will be sending data to the Prop, and that my devices probably need a clock type signal through CTS. I can get this to communicate fine to my laptop through that debug window. I get the idea of pushing buttons to control the debug or input numbers to have it converted and that sort of stuff. The problem is using the MAX3232E thing to interface at all between the Prop and my devices plugged to the RS 232.
Does anyone have any links or advice? I am very new to Propeller so please explain in detail if you can.
This Spaceball, as well as the Multimeters, do have Drivers that must be installed for Windows to properly interact with the devices. I am going off the assumption that these devices are simple things that send out pulses indicating their status after getting a 'Send me Data' signal, which probably goes through CTS. I assume any power, as far as VSS VDD, is provided by the jack I've been talking about in the bottom left corner of the PPDB.
Thanks for any help. Please remember I am very new to this specific Language and Chip. I can program TI calculators a bit in Basic, that is the extent of my programming knowledge, besides monkey see monkey do in BS2. As far as the electronics part the toughest thing I've done is make a spark gap with a 555 and ignition coil without any directions. Just to give you an idea of my programming and electronics knowledge (or lack thereof).
Programs that use overlay code were very popular in the era of early home computer systems when the amount of memory was not much, and the ability to load portions of code only when necessary allowed to make programs much larger than the available memory.
With microcontrollers we are in a similar situation with sometimes very complex programs and a rather limited memory, just think for example to the management of the SD card file system or the internet access libraries, that can severely limit the memory available for the program itself, especially if they are to be used simultaneously.
I've been reading these forums for a while but this is my first post. I've noticed that the parallax propeller rarely gets a. A port of gcc for the Propeller which. Then I ran my logic analyzer (at an excessively high sampling rate of 16MS/s) on TX, RX and GPIO0 (the latter being a simulated DTR signal). Read “Evaluating the Parallax Propeller P2 Chip” by Richard J. Morrison -an exploration of the P2’s unique capabilities and extensive, powerful instruction set Terry’s Workbench.
Apr 16, 2013.
The Parallax Propeller is a microcontroller with 32K of internal RAM memory and uses an external EEPROM to load the code to run at power up. Since only the first 32K of the EEPROM are used for the program it is possible to dedicate the exceeding space of larger memories for data storage. Datagrip 2016 2 2 download free. Fortunately with the GCC compiler and the standard tools it is also possible to store portions of the program code to be loaded when necessary.
The program
Build as an example a small program that writes two sentences on the serial port using two functions stored in two separate sources, then we will manage them through overlay.
The two source files might look like the following:
The program could simply initialize the serial port of the microcontroller, write a header to indicate that it is working and call the two functions above. We also add the source to manage the EEPROM using the I2C bus on the standard pins. Pixelmator 3 8 – powerful layer based image editor pixlr.
During the exposure I will refer the source code without carrying it in completely to not make the article too long. The attached package contains the complete sample files that can be used as reference.
Parallax Propeller Projects
The linker script
To use the overlays we instruct the linker on which object files are the code and where to place them in the microcontroller memory. To do this we must write a custom script.
We start from the standard script that can be found in the propeller-elf/lib/ldscripts directory with the name propeller.x. Copy the file in your working directory and rename it as propeller_ovl.ld. Open a text editor and load the file.
Parallax Propeller Activity Board
At the beginning of the script we find the MEMORY section that defines the memory areas in which to place the code and data. We need to define a new area in which to place the overlay code so add a line, like the one shown, just below the line that starts with hub:
This line defines a memory area called ovl that begins at location 28762 (28K) at the end of the internal ram with size 4096 (4K) bytes. All object files defined as overlays will be loaded in this area.
Because the area is located in the microcontroller’s ram memory, we must therefore reduce the memory available for the normal program code, so change the hub line with a length of 32K-4K=28K. The first lines of the script will be like these:
At this point we must tell the linker which object files make up the overlay code, so let’s move down the script until we get to the SECTIONS section. The first lines of this section in the standard script should be similar to the following:
So we are going to add an OVERLAY section immediately after the opening brace so that it is read before any other instruction:
The OVERLAY : NOCROSSREFS line defines the beginning of the section informing the linker that we are defining the overlay code and that each overlay can not call the code in other overlays. In the lines between braces we are going to insert the list of objects files containing the overlay code and data, one per line. In the example above we have two objects files overlay0.o and overlay1.o.
The last line with the closing brace defines the memory area in which the code is executed, the ovl area defined at the beginning of the script, and where each object is physically stored, in the drivers area which corresponds to the EEPROM memory area above 32K.
At this point the script may already be used as the linker automatically produces the required symbols to load the objects, however to further simplyfying things we add a table that can be used to load the code with a simple index.
Go down a bit more in the script until the .data section and modify it as follows:
Parallax Propeller C
The added rows defines a 2×3 long table called _ovly_table that we can use directly in C with a definition like the following:
The first element of each row contains the address of the internal ram memory to load the code to, the second element contains the size in bytes of the code and the third element the address where it is stored on the EEPROM.
The last step is to redefine the stack pointer since with the standard script it is placed at the address 0x8000 at the end of the ram memory, in the same area that will be occupied by the overlay code (remember that the stack expands downward).
The last line of the script contains the stack pointer definition, so we are going to change it so it points to the same address as the beginning of the overlay area at address 28*1024=28672 (7000 hex):
In this way there are no interferences between the overlay code and the stack.
![Parallax Parallax](https://sites.google.com/site/bifferboard/_/rsrc/1264542005992/Home/howto/serial-terminal-project/parallax-propeller-investigation/keyb.jpg?height=240&width=320)
The script is now complete and we can use it with the linker by adding the -T directive on the command line. In a typical makefile we will have a line like this:
The -T directive tells the linker to use the propeller_ovl.ld file as the customized linker script.
Overlay load
Now we have a program that compiles correctly, but when it runs it doesn’t show the output we are expecting because the two functions have not yet been loaded into memory. To load the code from the EEPROM we add the definition of the array generated by the linker and a function that loads the actual code:
In the program’s main function then add the call to the overlay load function just before calling the actual functions:
Program upload
To upload the program to the microcontroller it is necessary to use the propeller-load program that comes with the gcc toolchain. The program does not require any particular instruction as it is capable of detecting that a portion of the program must be loaded to the upper part of the EEPROM because of the use of the drivers memory area. Make sure to have at least a 64K EEPROM installed:
The sample output shows the data of the overlays loaded from the EEPROM.
Parallax Propeller Reading From A Serial Port Numbers
![Propeller Propeller](https://i.pinimg.com/236x/5c/f7/6e/5cf76ee5c1661e7363c9eae0a7d626d8.jpg)
Conclusions
Parallax Propeller Reading From A Serial Portal
Using programs with overlay code opens to many possibilities. In the attached example we used simple functions but nothing prevents you to have much more complex code, just beware of the limitations that we have now. The memory used by the overlays can not be used by the main program so complex overlay code occupying several K-bytes automatically reduces the available space. The code from an overlay can not call the code from another overlay, this is because it would be necessary to implement a call tracking system to load the correct code greatly increasing the complexity. Loading the code always takes some time so it is advisable to group functions toghether to minimize loads. Even with some limitations we now have the possibility to write programs greater than the 32K of available memory.
Links