[C.CC USERS] Serial questions

James Brown james.brown4994 at gmail.com
Sun Jan 13 22:18:04 GMT 2013


Hello

I want to experiment sending basic communications between 2 arduinos and
thought that simple serial comms was going to be easy.

However not so unfortunately.  I have tried searching the web for answers to
my questions which, I suspect, are not necessarily occam related.

1.  Can I use the TX RX pins on an uno or are they effectively redundant and
taken up for use by USB?  I was assuming I could simply have an occam
process generating a single byte to represent a signal to another program on
another board being triggered.  I was assuming I could connect the TX on
sender to RX on receiver (plus grounds).  Using both occam and c I have
tried to monitor the output on TX with an led to no avail.

Code
Sender
serial.write.byte (TX0, #AA)

Receiver
  WHILE TRUE
    SEQ
      serial.read.byte (RX0, read)
      IF
        read = #AA
          detected ! SIGNAL
        TRUE
          SKIP


2.  Using occam serial.write.byte I can get it generate something (i.e. at
least a flash on the TX LED on board) ONLY if connected to the PC's serial
monitor (in which case the byte is written out as an ascii character on the
monitor - that's ok).
3.  I cannot get it to accept anything other than bit rate 57600.  Anything
else generates garbage on the monitor.
4.  Looking at the "printing" module code I can see calls to procs such as
serial.byte.in.  What are these and where are they documented?
5.  Finally, if I want to use serial comms, will I have to use something
like "twi" (which seems quite complicated to start out with) or am I just
doing something hopelessly wrong?

Regards

James




More information about the users mailing list