 HELP! HSER issues from old to new
 HELP! HSER issues from old to new
		
		
				
				
		
			
				
					I had a couple of projects sending serial data to LCD's and that still works as far as i can tell, I don't have the displays to check. i also have a VB.net program that sends a single byte to a chip and that chip displays it on a parallel LCD, note that should still work too.  my problem is I am using a 8pin chip with no LCD, all I have is a LED to see if i'm getting data on the chip. I am also using the software "realterm" as a temporary interface till the VB program is written. i have tried for 4 hours now and its still not working, many configurations and such so I will state what I need and hopefully someone can insert missing code or provide links etc...  Project: Use a 12F1572 to read a 16 bit analog pin, send that 16bit data to the PC, then wait for response. PC will take number do some math, etc.. and then send a byte back to the chip to tell the chip to turn on a output pin to drive a LED or FET.  heres my basic layout of code  define OSC 4  DEFINE ADC_BITS 16 ' A/D number of bits DEFINE ADC_CLOCK 3 ' Uses A/D internal RC clock DEFINE ADC_SAMPLEUS 50 ' Set sampling time in us  define HSER_BAUD 9600 DEFINE HSER_BITS 8 DEFINE HSER_CLROERR 1 DEFINE HSER_RCSTA 90h DEFINE HSER_TXSTA 20h DEFINE HSER_SPBRG 25 DEFINE HSER_SPBRGH 0  A VAR WORD 'Stores 16 Bit Analog Reading B VAR byte 'Temp Holder Switch VAR PORTA.5 'Controls External FET or LED on pin 2 Switch = 0  mainloop:  ADCIN 2, A   'Grab analog input from Pin 3  Hserout [A]		' Send char out serial port pause 100  HSERIN [B] if B = 5 then switch = 1 else switch = 0	 pause 100  goto mainloop		' Do it all over again
				
			 
			
		 
			
                        	
		        
			
			Chris
Any man who has accomplished anything in electronics at one time or another has said... " STOP! WAIT! NOOO! Dangit.... Oh Well, Time to start over..."
			
			
		 
	
Bookmarks