Virtual Integrated Design

RS232 DVM Circuit

 

RS232 dvm main circuit

RS232

 

RS232 virtual dvm assembly drawing

RS232 dvm parts list

 

File 1:


#pragma option +v

// ad671.c
// 05/19/2000
// (C) Virtual Integrated Design

#include <12c671.h>
#include <tx14dvm.c>
#include <cvrt671.c>
#include <delay14.h>

void xmit_19200_4mhz(unsigned char);
unsigned char adc_result(void);

void main(void)
{

  TRIS=0xB; // 2=output 0,1,3,4,5=input
  ADCON0=0x01; // osc/2, AN0(pin 7) 
  ADCON1=0x4; // ref=vdd, (0,1 analog) (2,4 digital)
  GPIO.2=0; // TX to logic high level

  Delay_Ms_4MHz (50); // Delay before first transmit

  while(1)
  {
    xmit_19200_4mhz(adc_result());
    Delay_Ms_4MHz (50);
  }

}
//-----------------------------------------------
#include <delay14.lib>

File 2:

#pragma option +v

// cvrt671.c
// 05/19/2000
// (C) Virtual Integrated Design

#include <12c671.h>

unsigned char adc_result(void)
{
  ADCON0.GO=1;
  NOP();
  while(!ADCON0.DONE_);
  return ADRES;
}
//-----------------------------------------------

File 3:

#pragma option +v

// tx14dvm.c
// 05/16/2000
// (c)Virtual Integrated Design

// This file is intended to be used with the inverting output
// of the DVM circuit. 
// All timing was checked by oscilloscope at the micro output,
// not the RS232 output.

#include <12c671.h>
#include <delay14.h>

void xmit_19200_4mhz(unsigned char t) 
{
  unsigned char i;

  // Start Bit
  GPIO.2=1;
  Delay_10xUs_4MHz(3);
  NOP(); 
  NOP(); 
  NOP(); 
  NOP();

  for(i=0;i<8;i++)
  {
    t=t>>1;
    if(STATUS.C)
    {
      GPIO.2=0;
    }
    else
    {
      GPIO.2=1;
      NOP();
      NOP();
      NOP();
    } 
    Delay_10xUs_4MHz(3);
  }

  // Stop Bit
  NOP();
  NOP();
  GPIO.2=0;
  Delay_10xUs_4MHz(4);

}
//-----------------------------------------------
#include <delay14.lib>

Hex File:

:020000040000FA
:0600000000308A003E28DA
:06000A008312A0000515A1
:0800100003302A20000000006B
:08001800000000008312A101A9
:080020000830831221020318CD
:0800280024280310A00C031CA6
:080030001B2805111F2805150E
:0800380000000000000003308D
:080040002A208312A10A1028F6
:08004800000000000511043066
:080050002A2008008312FF00C2
:080058000000000000000000A0
:08006000000000000000FF0B8E
:080068002C28080083121F156B
:08007000000083121F1D392856
:080078001E0808000B3083167E
:080080008500013083129F008E
:08008800043083169F0083126F
:08009000051132305120362029
:080098000520323051204B28F5
:0800A00008008312FF00F93093
:0800A80084000000840B5528C0
:0600B000FF0B53280800BD
:00000001FF


Free RS232

 Home | Applications | Industry Links | C++ Builder Stop | Micro Stop | Hex to Ascii Chart