• AVR Freaks

Hot!UART on PIC32 usb starter kit 3

Author
polinag96
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/10/02 11:22:31
  • Location: 0
  • Status: offline
2019/11/19 14:23:28 (permalink)
0

UART on PIC32 usb starter kit 3

I am writing letters to test my UART module on a PIC32 mx usb starter kit 3. I am using Harmony's USART library and 
DRV_USART_WriteByte(appData.handleUSART0, 'H')
to send data to my Tx pin. I connected a wire from an analog tool to read the value of Tx pin and I am consistently getting the wrong output of "ú" for "H" I am sending. I am always reading the wrong values regardless of what I send. Can anyone please help me out?
#1
ric
Super Member
  • Total Posts : 24638
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: UART on PIC32 usb starter kit 3 2019/11/19 14:29:58 (permalink)
5 (1)
What baud rate is your PIC set to?
What baud rate is the tool set to?
 
A better test would be to send 'U' which is 0x55, and examine the waveform with a scope. Then you can easily see the width of the alternating high and low pulses.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#2
polinag96
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/10/02 11:22:31
  • Location: 0
  • Status: offline
Re: UART on PIC32 usb starter kit 3 2019/11/19 15:17:03 (permalink)
0
PIC is set to 9600 and tool is set to 9600. I passed "U" and I got "88þ" as my output. 
#3
ric
Super Member
  • Total Posts : 24638
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: UART on PIC32 usb starter kit 3 2019/11/19 15:52:59 (permalink)
0
polinag96
I passed "U"

Yes, that is what I suggested.

and I got "88þ" as my output.

I said to look at the width of the pulses with a scope.
 
Is this tool expecting TTL level signals (i.e. what appears directly on the PIC TX pin), or RS232 level signals (what you would see on the RS232 port of a PC etc.) RS232 signals are inverted from TTL signals.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#4
NKurzman
A Guy on the Net
  • Total Posts : 18060
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: UART on PIC32 usb starter kit 3 2019/11/19 16:41:21 (permalink)
0
polinag96
PIC is set to 9600 and tool is set to 9600. I passed "U" and I got "88þ" as my output. 



You sent 1 char and the receiver got 3 chars?  That sounds like a Baud Rate Issue. 
#5
ric
Super Member
  • Total Posts : 24638
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: UART on PIC32 usb starter kit 3 2019/11/19 16:47:05 (permalink)
5 (1)
NKurzman
You sent 1 char and the receiver got 3 chars?  That sounds like a Baud Rate Issue. 

Indeed, and doing the test I suggested would confirm it.
I suspect the method used to set the Baud Rate in the PIC is faulty.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#6
Jump to:
© 2019 APG vNext Commercial Version 4.5