It is currently 20 Oct 2018 09:23

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Pic24 UART Problem
PostPosted: 22 Mar 2018 13:09 
Offline

Joined: 11 Sep 2017 09:39
Posts: 10
Hi,

i have a pic24fj256gb110 and i am trying to use its uart. But i couldnt get anything yet. my board and uart route is fine and my signal is fine. i have checked it with oscilloscope.

here is my project
Attachment:
My Project.rar [246.83 KiB]
Downloaded 15 times

Thank you.


Top
 Profile  
 
 Post subject: Re: Pic24 UART Problem
PostPosted: 22 Mar 2018 15:02 
Offline
mikroElektronika team
User avatar

Joined: 25 Jan 2008 09:56
Posts: 10017
Hi,

You can check the UART example for the mikromedia for PIC24 board which carries the same MCU :
https://www.mikroe.com/mikromedia-3-pic24fj

Regards,
Filip.


Top
 Profile  
 
 Post subject: Re: Pic24 UART Problem
PostPosted: 23 Mar 2018 09:59 
Offline

Joined: 11 Sep 2017 09:39
Posts: 10
I did 1000 times. The problem is the program enters this if function(if(UART1_Data_Ready))) just once at first without data, then it doesnt work.


void main() {

  InitVTFTStack();
  UART1_Init(9600);
  Delay_ms(100);


  while (1) {
    ProcessVTFTStack();
    if (UART1_Data_Ready()){
    EveNumber1.Value = UART1_Read();
    Drawscreen(&Screen1); }
    }
  }


void Init_MCU()
 {

AD1PCFGL = 0xFFFF;
AD1PCFGH = 0xFFFF;

FT810_RST_Direction=0;
FT810_CS_Direction=0;

Unlock_IOLOCK();
PPS_Mapping_NoLock(17, _INPUT, _SDI1);
PPS_Mapping_NoLock(15, _OUTPUT, _SCK1OUT);
PPS_Mapping_NoLock(10, _OUTPUT, _SDO1);
PPS_Mapping_NoLock(31, _OUTPUT, _U1TX);
PPS_Mapping_NoLock(32, _INPUT, _U1RX);
Lock_IOLOCK();

SPI1_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 1, 1, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_IDLE_2_ACTIVE);
}


Top
 Profile  
 
 Post subject: Re: Pic24 UART Problem
PostPosted: 27 Mar 2018 14:32 
Offline
mikroElektronika team
User avatar

Joined: 25 Jan 2008 09:56
Posts: 10017
Hi,

Are you able to test this with the minimal code (that does not include VTFT code) ?

Which pins do you want to use for UART ?

Regards,
Filip.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: