electronicsuk
Newbie level 4
vb6 serialoutput byte
I'm currently designing a computer serial port interface using PIC BASIC and the 16F84A microcontroller. I have outputs all figured out, but I would also link to be able to input to the computer from the PIC. Of course I will be using the rx pin on the serial port for this, the problem is programming the PIC. I don't want to have to poll the microcontroller every time I want to read the status of its inputs. I am trying to configure the system to automatically send data to the rx pin on the serial port whenever an input on the PIC goes high. That would be ok, but the problem is that I want to have more than one of these units connected to the port. Output is easy, just address a certain PIC and then send it the data. But with the input to the serial port, what if more than one PIC tries to send at the same time? I was thinking about making the PIC watch the rx line and check it's not busy before sending, and then toggling the pin to an output and sending the data. Even after that, it's still possible two PIC's could send at the same time if both inputs were activated at exactly the same time. So, any ideas? Any resources on the internet I could look at? Your help is much appreciated.
Best regards,
Matthew
I'm currently designing a computer serial port interface using PIC BASIC and the 16F84A microcontroller. I have outputs all figured out, but I would also link to be able to input to the computer from the PIC. Of course I will be using the rx pin on the serial port for this, the problem is programming the PIC. I don't want to have to poll the microcontroller every time I want to read the status of its inputs. I am trying to configure the system to automatically send data to the rx pin on the serial port whenever an input on the PIC goes high. That would be ok, but the problem is that I want to have more than one of these units connected to the port. Output is easy, just address a certain PIC and then send it the data. But with the input to the serial port, what if more than one PIC tries to send at the same time? I was thinking about making the PIC watch the rx line and check it's not busy before sending, and then toggling the pin to an output and sending the data. Even after that, it's still possible two PIC's could send at the same time if both inputs were activated at exactly the same time. So, any ideas? Any resources on the internet I could look at? Your help is much appreciated.
Best regards,
Matthew