serial communication
Vladimir Andrejev
Posts: 8
I am hoping to use the propeller chip to deal with the Parallax GPS reciever and Bluetooth.· However these both require serial ports.
can i do these on any pins?· or are there dedicated pins for serial communication.· I know p30 and p31 handle serial on boot, but can other pins handle serial during run-time?
I am a little worried that the popeller can't do both GPS and Bluetooth if only p30 and p31 can handle this?
Any suggestions?
Cheers guys.
can i do these on any pins?· or are there dedicated pins for serial communication.· I know p30 and p31 handle serial on boot, but can other pins handle serial during run-time?
I am a little worried that the popeller can't do both GPS and Bluetooth if only p30 and p31 can handle this?
Any suggestions?
Cheers guys.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yes you can use any of the 32 IO-pins for serial connections.
The serial communication is completely organized by a softwaredriver
EVERYTHING buffer for sending data and buffer for incomming data is done by software
there is no hardware UART needed. And as it is done in software you are able to change the size of these buffers !
As with all other microcontrollers only voltage-level-shifting from 3.3V to TTL or V24 (+-12V) OUTSIDE the propellerchip
is needed.
You have 8 co-processors inside one propellerchip and each cog can handle 1-4 serial connections
all 32 IO-Pins are general purpose. AFTER Boot-up-procedure (takes about 2 seconds after Power on to the propeller)
Boot Up Procedure
Upon power-up (+ 100 ms), RESn low-to-high, or software reset:
1. The Propeller chip starts its internal clock in slow mode (≈ 20 KHz), delays for 50 ms
(reset delay), switches the internal clock to fast mode (≈ 12 MHz), and then loads and
runs the built-in Boot Loader program in the first processor (Cog 0).
2. The Boot Loader performs one or more of the following tasks, in order:
a. Detects communication from a host, such as a PC, on pins P30 and P31. If
communication from a host is detected, the Boot Loader converses with the
host to identify the Propeller chip and possibly download a program into
Main RAM and optionally into an external 32 KB EEPROM.
b. If no host communication was detected, the Boot Loader looks for an
external 32 KB EEPROM (24LC256) on pins P28 and P29. If an EEPROM
is detected, the entire 32 KB data image is loaded into the Propeller chip’s
Main RAM.
And for instance it will be much easier tp program a serial connection with the propeller
than with any other microcontroller
call a command "Start serialdriver" and then send and receive data. Thats all !
here is a little demo-program
best regards
Stefan
The standard fullduplex driver needs 1 cog to run it. There are low speed (19200 I think) drivers that run in spin and dont need a dedicated cog. There is also a fullduplex serial port driver that runs 4 ports with 1 cog upto 115200 baud. The most number of serial ports I have seen is 5 or 6 ports using the 4 port driver.
One of the demo program for the 4 port serial driver, runs 3 copies of the driver, with a total of 7 ports.
Post Edited (Timmoore) : 9/16/2008 8:22:48 AM GMT
Have a look at page 18 of the Prop manual, the boot process.
Ron
Good post but I am not sure i am convinced on the following:
from my experience using the serial object from ASM code in another cog, you have to make explicit effort to poll to empty or fill the ringbuffer frequently enough to maintain constant data rate. Polling = usually a lot of wasted cycles
on the other hand, i know another similarly priced mcu that can use interrupts or better yet on-chip deeply-integrated DMA to take care of these inconveniences. By no means i say lack of interrupts is necessarily a disadvantage - it's just prop has a different philosophy about it. And i think that asynchronous serial comm is not a strong point of this philosophy.