FULLDUPLEXSERIAL_TEST1
Table of Contents |
FullDuplexSerial_Test1Object file: FullDuplexSerial_Test1.spin Version: 1.1 Date: 2006 - 2011 Author: Daniel Harris Company: Parallax Semiconductor Email: dharris@parallaxsemiconductor.com Licensing: MIT License - see end of file for terms of use. Revision History: v1.1 - 5/1/2011 Original test file
Global CONstantsSOURCE CODE... 'Set up the clock mode _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '5 MHz clock * 16x PLL = 80 MHz system clock speed Used OBJectsFullDuplexSerial_Test1.spin │ └──FullDuplexSerial_rr004.spin SOURCE CODE... serial : "FullDuplexSerial_rr004" PUBlic Spin MethodsMainStarts execution of FullDuplexSerialTest1.spin This is a very simple test. It starts the object, waits 1 second, prints two lines to the terminal, waits 1 more second, then shuts down. Set your terminal to a baud rate of 9600 baud to see the output. parameters: none return: none example usage: N/A - executes on startup SOURCE CODE... PUB Main 'start the FullDuplexSerial object serial.Start(31, 30, %0000, 9_600) 'requires 1 cog for operation waitcnt(cnt + (1 * clkfreq)) 'wait 1 second for the serial object to start serial.Str(STRING("Testing the FullDuplexSerial object.")) 'print a test string serial.Tx($0D) 'print a new line serial.Str(STRING("All Done!")) waitcnt(cnt + (1 * clkfreq)) 'wait 1 second for the serial object to finish printing serial.Stop 'Stop the object License┌──────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this │ │software and associated documentation files (the "Software"), to deal in the Software │ │without restriction, including without limitation the rights to use, copy, modify, │ │merge, publish, distribute, sublicense, and/or sell copies of the Software, and to │ │permit persons to whom the Software is furnished to do so, subject to the following │ │conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies │ │or substantial portions of the Software. │ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, │ │INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A │ │PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT │ │HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF │ │CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE │ │OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────┘ |