Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] how to check the uart transmission in proteus?

Status
Not open for further replies.
There is a bug in Proteus related to baudrate. Change baudrate to 1200 bps or 2400 bps in Proteus Virtual Terminal. It will display properly. Keep baudrate as 9600 bps in code.

I don't know of any bug in Proteus using a PIC at 9600 baud or at any other baud rate. I have just written a PIC UART Program (in assembler) using the Proteus virtual terminal and I have not seen any bugs. Please describe the bug in more detail.
The Proteus PIC UART simulation is bug free in my testing of it, any problems must be the software.
 

Not all PICs but some PIC models. See the PIC he is using. His baudrate according to code is 9600 bps but if 9600 bps is selected in Proteus Virtual Terminal he gets garbage. If 1200 or 2400 bps is selected in VT then it displays properly.
 

Hi it was shown in its data sheet....

untitled.JPG

x = Fosc/(16*rate) - 1

for rate = 9600; x = 129.. and its works fine in 9600 baud
 

according to data sheet Baud rate = Fosc / (16(x+1)) right??
so (x+1) = Fosc / (16 * BR)
then x = Fosc / (16 * BR) - 1
x = 20000000 / (16 * 9600) - 1 //This operation cant be done with a 16bit int variable""
x = 129
 


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
main()
{
inits();
while(1)
{
  mon_keypad();
  if(key_activate == 1)
   {
   UART_Write( '0' + key );
   }
}
}


do like this interface keypad completely in mon_keypad function....
 

we will check the uart is working or not using hyperterminal.....in hyperterminal whatever we entered that will displayed in hyperterminal.....in such a way i am asking that.......if i entered a character 'a' that should be displayed.....is it possible?this is for uart checking...
 

yeah for the above working hello code if you connect a Max 232 with pic and connect it to com port you will get the output on screen, you can use keypad to give input if you wrote a serial receiver program...
 

for serial receiver program we have to write coding asynchronous receiver.....

- - - Updated - - -

HTML:
while(!RCIF)
continue;
return RCREG;



is this enough for receiver coding?
 

by using ISR you can avoid wasting time in while until receiving data.... if any successful data received a interrupt will be invoked so in ISR we will read the received value...
 

look at the htc example files for detailed explanation....
by using the keyword interrupt inbetween datatype declaration and function name
like,

Code C - [expand]
1
2
3
4
5
6
7
void interrupt ISR()
{
if(T0IF)
{
some thing timer 
}
}

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top