Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Serial comm between uC and PC...

Status
Not open for further replies.
Call your college and ask your money back.
Why college i have buy it from Robokits india the whole USB module you can see in previous post...
please tell what changes to do for using it????
 
Ok. If you want help, post full schematics and all the code you have done so far. Without those I can't do anything to help you.
 
This the code drawing schematic....


Code:
#include <htc.h>
__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);
#define _XTAL_FREQ 20000000





unsigned char  HSerin(void);
void HSerout(unsigned char ch), HSerinit(void);
 
void main(void)						// program entry
	{
	int index = 0;
	unsigned char ch;
	ADCON1 = 0x6;					// Analogue off					
	HSerinit();
       __delay_ms(150);
	while(1)						// endless Loop
		{
		ch = HSerin();				// wait for a character
 		HSerout(ch);				// Echo back
 
		}
	}
 
void HSerinit()
 
Last edited:
Why two different codes?
 
Where to draw schematic i have orcad 16.5 installed but some problem is there will drawing i am new to it still working on it!!
 
I have used both for echo back and second for writing from uC to PC terminal window i have tested both but nothing is working!!
 
I have used both for echo back and second for writing from uC to PC terminal window i have tested both but nothing is working!!

You need to calm down and test more! Try to find out is the hardware ok. Then read the microcontroller datasheet and and check your USART settings. Read the datasheet. Study how the USART works.
 
Is the USB to serial converter working?

Yes, when i have connected the RX to TX of USB the text was comming back to terminal window..

here is the schematic!
 

Attachments

  • SCHEMATIC1 _ UARTTESt.pdf
    21.3 KB · Views: 254
What PIC are you actually using? Your compiler says "--chip=16F877A ", but your schematic says 16F873

Read the datasheet and check your code. Every setting you make.. you need to go through it and check everything using the datasheet.
 
I am using pic16f877a only but in orcad it was not there!

Yeah.. thanks for the incorrect schematics very helpful. You draw that **** just for me? thanks alot.

I see what your problem is. You don't even care enough to send proper schematics. I can't waste my time for this if you are too lazy to provide proper information.
 
Code for a 16f873a will run on a 16f877a there the same core but the 16f877a has more pins so it may not work for the 28 pin chip if you don't watch ports.
 
Sheesh, I have read and re-read this thread...all I can say is it reminds me of a service call to Vodafo**
Right from the off you know where's it's going, but you just have to follow along anyway for the pain of it :D
 
Code for a 16f873a will run on a 16f877a there the same core but the 16f877a has more pins so it may not work for the 28 pin chip if you don't watch ports.

Hi,
The code is for 877 in schematic was drawn in Orcad so, there was no 877 in library file that why for showing i have it ......
 
Hi,
The code is for 877 in schematic was drawn in Orcad so, there was no 877 in library file that why for showing i have it ......

PICs are NOT interchangeable. You MUST check the pinouts and rewire them if necessary. Otherwise nothing will work.


. . . . . .. . . . . . . . . . . ,.-‘”. . . . . . . . . .``~.,
. . . . . . . .. . . . . .,.-”. . . . . . . . . . . . . . . . . .“-.,
. . . . .. . . . . . ..,/. . . . . . . . . . . . . . . . . . . . . . . ”:,
. . . . . . . .. .,?. . . . . . . . . . . . . . . . . . . . . . . . . . .\,
. . . . . . . . . /. . . . . . . . . . . . . . . . . . . . . . . . . . . . ,}
. . . . . . . . ./. . . . . . . . . . . . . . . . . . . . . . . . . . ,:`^`.}
. . . . . . . ./. . . . . . . . . . . . . . . . . . . . . . . . . ,:”. . . ./
. . . . . . .?. . . __. . . . . . . . . . . . . . . . . . . . :`. . . ./
. . . . . . . /__.(. . .“~-,_. . . . . . . . . . . . . . ,:`. . . .. ./
. . . . . . /(_. . ”~,_. . . ..“~,_. . . . . . . . . .,:`. . . . _/
. . . .. .{.._$;_. . .”=,_. . . .“-,_. . . ,.-~-,}, .~”; /. .. .}
. . .. . .((. . .*~_. . . .”=-._. . .“;,,./`. . /” . . . ./. .. ../
. . . .. . .\`~,. . ..“~.,. . . . . . . . . ..`. . .}. . . . . . ../
. . . . . .(. ..`=-,,. . . .`. . . . . . . . . . . ..(. . . ;_,,-”
. . . . . ../.`~,. . ..`-.. . . . . . . . . . . . . . ..\. . /\
. . . . . . \`~.*-,. . . . . . . . . . . . . . . . . ..|,./.....\,__
,,_. . . . . }.>-._\. . . . . . . . . . . . . . . . . .|. . . . . . ..`=~-,
. .. `=~-,_\_. . . `\,. . . . . . . . . . . . . . . . .\
. . . . . . . . . .`=~-,,.\,. . . . . . . . . . . . . . . .\
. . . . . . . . . . . . . . . . `:,, . . . . . . . . . . . . . `\. . . . . . ..__
. . . . . . . . . . . . . . . . . . .`=-,. . . . . . . . . .,%`>--==``
. . . . . . . . . . . . . . . . . . . . _\. . . . . ._,-%. . . ..`
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top