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.

Software UART reception failure

Status
Not open for further replies.

helmi_mjd

Member level 2
Joined
Feb 20, 2011
Messages
45
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,668
Hi guys...
I have one problem regarding the software UART. It can transfers a character from Micro-controller but when i try to send from PC (through bluetooth), the micro-controller does not received it. This indicated by LED. Can anyone help me solving this problem? Here i attached the code.
PIC: 18F4520, Programmer: MPLAB IDE, Compiler: Hi-Tech C PIC18 (PRO)
 

Attachments

  • Software UART_PIC18F4520.txt
    5.2 KB · Views: 45

You are not using interruption to handle reception, and polling is not a good approach.
Take a look here to inspire at some implementations :




+++
 

You are not using interruption to handle reception, and polling is not a good approach.
Take a look here to inspire at some implementations :




+++

Thanks andre_teprom for fast reply. I will follow your suggestion and will let you know the after i make changes. Thanks again.
 

Hi andre, i already edit my code using reception interrupt but i still can't get the result. Could you please check my interrupt routine/any other part of my code is incorrect? Attached is the code. I used pin change interrupt for reception at RB7.
 

Attachments

  • Software UART_PIC18F4520_edited.txt
    6.3 KB · Views: 53

helmi_mjd,


Taking a quick overview, I noticed the following issues :
  • You inserted a delay into reception routine, which is not recomended;
  • You used interrupt based on pin-change, not properly based on uart reception itself;

Once I admit did not performed a more accurate analysis, and pehaps could happen other problems, I sugest you try compile other working examples, and just after, extract fragments to your code.


+++
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top