Author Topic: A Half Duplex Network  (Read 1893 times)

0 Members and 1 Guest are viewing this topic.

Offline crobertsTopic starter

  • Regular Contributor
  • *
  • Posts: 94
  • Country: us
A Half Duplex Network
« on: April 11, 2013, 03:24:26 pm »
All of the PCBs in my Solar Powered LED lighting system are networked with a simple half duplex network. I have been working to improve the network transaction time (how often each network object can be polled). I have rewritten the assembly language code for the communications state machine and have the transaction time down to 1mS. The main difference in the code is I am waiting first for the TXSTA,TRMT bit to clear and then to be set after a transmission (the TRMT bit indicates the state of the transmit shift register and can only be polled). This allows me to set the direction of the MAX487 to receive as soon as possible when the transaction requires it. I have the communications state machine in the interrupt handler that executes every 200uS and waiting for the TRMT bit to go high before leaving the interrupt handler means Timer0 (rollover causes interrupt) will rollover before I leave but that is OK because I add the current Timer0 value to the preset value required to achieve 200uS and the timing will self correct before the next transaction occurs (1mS).

The test circuit has a Master and Slave connected by one twisted pair driven by the MAX487s. When you change the switch settings at the Master you see the LEDs change at the Slave and vice versa.

The protocol is the same as described in the topic I did for a Full Duplex Network and that can be found here;

https://www.eevblog.com/forum/microcontrollers/a-full-duplex-network/

Attached are the following;
Test Circuit Schematic as PDF
Master assembly language code as ASM
Slave assembly language code as ASM
TXSTA,TRMT flowchart as PDF





« Last Edit: April 12, 2013, 11:50:15 am by croberts »
 

Offline crobertsTopic starter

  • Regular Contributor
  • *
  • Posts: 94
  • Country: us
Re: A Half Duplex Network
« Reply #1 on: April 12, 2013, 11:53:55 am »
Hello All

I made a correction to the test schematic in the original post. The MAX487s were not labeled.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf