Can someone help me? Serial Communications
Furball
Posts: 4
Im kind of new to the .spin language and im in need of some help, i have been doing a little homework on the propeller chip but now im in need of some help, im needing a program that when a switch is closed it will output via RS232, a hex statemet of FE 1E, for some reason i think im making this harder than it needs to be. Can someone help me learn what im going wrong?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Working on getting money for autopilot project. Come check out my site if your interested in the project. Maybe go to the bottom of the page
RS-232 E3C Networkable Relay Controllers that needs FE 1E to turn on all the relays, its 9600 baud
You could send fe 1e with
Simply add the constants to your CON section, setting TX to your transmit pin. Messages are defined in the DAT section and must be terminated with 0.
Here is the code:
(edit: sorry, I missed the @ in the CommTX call.)
- eeo
Post Edited (blackmesa82) : 8/19/2009 6:55:04 PM GMT
as you seem to ´be a newbee I would like to state some additional things
the FullDUplexSerial-objects sends data at the specified baudrate in 8N1-format which is very common
8N1 8 databits no parity 1 stopbit
but there are also others like 7E2 7 databits equal parity 2 stopbits or 8N2, 8E1, or 8O1, etc. etc.
the parameter mode specifies details about the electronical circuit of the Rx and the Tx-line
mode 0 is common
I guess the Relay-control expects real RS232 voltage-levels which is +12V/-12V.
The propeller-IO-pins deliver 0V/3.3V so you need a voltage-levelshifter chip like the MAX2323
you should use a current-limiting resistor of 150 Ohms to avoid damaging an IO-pin if the IO-PIN is accidently configured wrong
the IO-PIN connected to the switch
you should use a PULL-down-resistor of 10kOhm to get a clear defined state of the IO-PIN while the switch is open
the Pull-down-resistor as its name says pulls down the IO-PIN to low=0V.
Without a Pull-down-resistor the state of the IO-PIN is free floating and the state will change between low and high
in an unpredictable way
below is a demoprogram that shows one of 2 dozens of solutions to what you have described above
download the program to the EEPROM
then start the PST.EXE (Parallax Serial Terminal) adjust baudrate to 115200
reset the prop while PST is connected to the prop and watch the debug-output
depending on what you want to do in the end another solution might be more suitable
best regards
Stefan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm