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.

Serial Communication with PIC18f4550

Status
Not open for further replies.

Afnan_123_

Newbie level 6
Newbie level 6
Joined
Feb 19, 2013
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,355
Hi everyone,,
please anyone can tell me how to do serial communication with pic18f4550?? i am using LabView ,, i connected the RS232 and MAX232 with pic18f4550 ,,but how the code will be for the serial??
i attached my file that contain Proteus file and the code for the circuit

Can ant one tell me who to add part of serial communication code?
 

Attachments

  • NEW AFNAN.zip
    108.3 KB · Views: 60

Hi everyone,,
please anyone can tell me how to do serial communication with pic18f4550?? i am using LabView ,, i connected the RS232 and MAX232 with pic18f4550 ,,but how the code will be for the serial??
i attached my file that contain Proteus file and the code for the circuit

Can ant one tell me who to add part of serial communication code?

sala.bro 1st of all u need the compim(a serial port in proteus) dat will make u define a specific address to ur dat serial port,secondly if u r doin it virtually then u wud me needing a virtual connection between the port in proteus and the one in labview thats where the virtual serial port emulator comes in(easily available on net) from dat u will havto make a pair between ur port in proteus and in labiew..
the code for serial is very simple.( visa open--- read/write block --- Visa close) read the help for defining the configuration of serial port in labview its very simple. and use a block 'bytes at port' before the read block so that the bytes sent by the PIC cud b processed. :)
 

i see that ur code is in assembly , and i have not used assembly to program serial port , i advise u to move to micro C , very easy and cheap . and effeicent

but if you still want to program using assembly , here what you should do : 1- download the complete datasheet (refernce manual ) usaully big and over 5 megabyte and contains the family for example :18fXX50
2- check for the register of serial initialization
3- fill in with the data required , then use the functions to read or send data BYTE by BYTE by acess the data buffer registers ..

Every thing you need is in the data sheet

hope that helps
good luck
 

i see that ur code is in assembly , and i have not used assembly to program serial port , i advise u to move to micro C , very easy and cheap . and effeicent

but if you still want to program using assembly , here what you should do : 1- download the complete datasheet (refernce manual ) usaully big and over 5 megabyte and contains the family for example :18fXX50
2- check for the register of serial initialization
3- fill in with the data required , then use the functions to read or send data BYTE by BYTE by acess the data buffer registers ..

Every thing you need is in the data sheet

hope that helps
good luck

no my code in c
i am working in Mickro C
the file that i uploaded contains file in assembly and C ,, just see the c code
 

Hi,
Kindly run the UART example provided by mikroC, and check it in the "Terminal" provided by them in IDE. Hardware connection diagram is also given in help file.
Code:
char uart_rd;

void main() {
  ANSEL  = 0;                     // Configure AN pins as digital
  ANSELH = 0;
  
  UART1_Init(9600);               // Initialize UART module at 9600 bps
  Delay_ms(100);                  // Wait for UART module to stabilize
  
  UART1_Write_Text("Start");
  UART1_Write(10);
  UART1_Write(13);
  
  while (1) {                     // Endless loop
    if (UART1_Data_Ready()) {     // If data is received,
      uart_rd = UART1_Read();     // read the received data,
      UART1_Write(uart_rd);       // and send data via UART
    }
  }
}
Hope this helps..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top