Linking spin objects - objects not co-operating
lanternfish
Posts: 366
Hi all
As the obvious will be staring me in the face, a welcome slap from the more observant of you will be welcome.
The 'project' consists of a DMX transmitter, DMX receiver and serial terminal all in the same Prop. This is being tested on a QuickStart board. P19 is the DMX tx port and is linked by a jumper to the DMX in port on P23. So ...
using jm_dmx_monitor.spin as a starting point and using DMXout.spin, jm_dmxin.spin and jm_txserial.spin from the OBEX I modified jm_dmx_monitor.spin to produce:
The problem is when DMXout.spin fires up there is no serial output to the PC. When DMXout is commented out there is serial output to the PC.
Attached are the supporting objects:
Completely flumuxed. Any help appreciated.
As the obvious will be staring me in the face, a welcome slap from the more observant of you will be welcome.
The 'project' consists of a DMX transmitter, DMX receiver and serial terminal all in the same Prop. This is being tested on a QuickStart board. P19 is the DMX tx port and is linked by a jumper to the DMX in port on P23. So ...
using jm_dmx_monitor.spin as a starting point and using DMXout.spin, jm_dmxin.spin and jm_txserial.spin from the OBEX I modified jm_dmx_monitor.spin to produce:
'' ================================================================================================= '' '' Small modifications made to jm_dmx_monitor.spin to run '' a cog as a DMX input device using DMXout.spin. '' '' Lindsay Gordon (aka lanternfish) '' '' ================================================================================================= '' '' File....... jm_dmx_monitor.spin '' Purpose.... Simple program to monitor DMX channel values '' Author..... Jon "JonnyMac" McPhalen (aka Jon Williams) '' Copyright (c) 2009 Jon McPhalen '' -- see below for terms of use '' E-mail..... jon@jonmcphalen.com '' Started.... 15 SEP 2009 '' Updated.... 20 SEP 2009 '' '' ================================================================================================= con _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 #1, HOME, #8, BKSP, TAB, LF, CLREOL, CLRDN, CR, #16, CLS ' PST formmatting control DMX_START = 1 ' monitor channels 1 - 24 DMX_END = 24 obj term : "jm_txserial" dmx : "jm_dmxin" dmxtx : "DMXout" pub main | chan dmxtx.start(19) ' for QuickStart board P19=tx waitcnt(clkfreq / 10 + cnt) dmx.init(23, 22) ' for QuickStart board P23=rx P22=led term.init(30, 115_200) ' use programming port waitcnt(clkfreq / 10 + cnt) repeat term.str(string(CLS, "DMX Monitor")) term.tx(HOME) term.tx(LF) term.tx(LF) repeat chan from DMX_START to DMX_END term.rjdec(chan, 3) term.str(string(" ")) term.rjdec(dmx.read(chan), 3) term.tx(CR) waitcnt(clkfreq / 100 + cnt) ' wait 10ms dat {{ Copyright (c) 2009 Jon McPhalen (aka Jon Williams) 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 NON-INFRINGEMENT. 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. }}
The problem is when DMXout.spin fires up there is no serial output to the PC. When DMXout is commented out there is serial output to the PC.
Attached are the supporting objects:
Completely flumuxed. Any help appreciated.
Comments
And that is the problem (DMXout not returning). All good now.
As I am only just getting into spin your suggestion and a re-read of the manual highlighted the obvious.
Now to get on with the rest of the project.