UART interrupt problem

General discussion on mikroC PRO for PIC.
Author
Message
Sparky1039
Posts: 1179
Joined: 24 Nov 2005 20:07
Location: Colorado, USA

Re: UART interrupt problem

#16 Post by Sparky1039 » 20 Mar 2013 06:33

Code: Select all

GPSin==UART2_Read(); //store chracter of GPS data
Well line this is going to be a problem (same problem, multiple places)

The double equal sign "==" is the logical test for equality i.e. if x equals y then do something, or in code... if (x == Y) count++;.

A single equal sign "=" is the assignment operator i.e. X is assigned the value of 16, or in code... X = 16;

So...

Code: Select all

GPSin==UART2_Read(); 
really should be...

Code: Select all

GPSin = UART2_Read();  
Mixing up == with = is a common mistake and something you need be on the lookout for. :wink:

yosyap
Posts: 1
Joined: 05 Aug 2014 19:16

Re: UART interrupt problem

#17 Post by yosyap » 05 Aug 2014 22:15

Hello

I'm not such a great programmer so I won't be surprised if I made ridiculous mistakes...

I'm trying to write to the terminal the GPGGA coordinates similarly to the code mentioned above here, but all I'm getting in the terminal is gibberish' so I can't know if the interrupt is working properly.

I've tried to set the error in the baud rate CLK with setting the spbrg=0x33 unsuccessfully.

does anyone know what other options I have?

Post Reply

Return to “mikroC PRO for PIC General”