Hi, I am new to flowcode and have produced my first program (successfully) after much trial and error. Otherwise known as learning the hard way! The file is attached. Simply I have used an ADC to generate a number from 0-25. An interrupt on B0 sends the value to the SendRS232 which outputs the number on the black window. I have used pin D0 to send the serial output from. My problem is, I cannot find/work-out how to use a single output wire from D0 to an input of a second chip to program a second RS232 rx to accept the serial output and convert it back. Does the output send a start pulse to warn the receiver, that a byte is about to arrive? Flowcode will not let me place a second RS232 to act as the receiver/converter. Can anyone help? Thanking someone in anticipation.
Mikey
RS232 reception
-
- Valued Contributor
- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: RS232 reception
Here are some comments on the supplied code:
The interrupt icon should not be in the main program loop, it is only required at the start of the program. This piece of code only needs to be executed once to configure the interrupt. After this the interrupt macro will always be executed if the interrupt condition is detected.
The serial output can not be configure for general outputs. the RS232 component uses the USART peripheral in the microcontroller to transfer data. In a PIC16F877 the Tx pin is C6 and the Rx pin is C7. The RTS and CTS pins are for hardware handshaking and should be disabled for initial development.
You should be able to connect the Tx pin of one microcontroller to the Rx pin of another microcontroller (or the same microcontroller - loopback) and transmit a data byte from one to the other. The receiving device must be executing a program loop that is continually checking for received data.
The interrupt icon should not be in the main program loop, it is only required at the start of the program. This piece of code only needs to be executed once to configure the interrupt. After this the interrupt macro will always be executed if the interrupt condition is detected.
The serial output can not be configure for general outputs. the RS232 component uses the USART peripheral in the microcontroller to transfer data. In a PIC16F877 the Tx pin is C6 and the Rx pin is C7. The RTS and CTS pins are for hardware handshaking and should be disabled for initial development.
You should be able to connect the Tx pin of one microcontroller to the Rx pin of another microcontroller (or the same microcontroller - loopback) and transmit a data byte from one to the other. The receiving device must be executing a program loop that is continually checking for received data.