Transmit ASCII character using UART - PIC32MX170F256B.

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 8-bit PIC MCUs.
Post Reply
Author
Message
Skyfall
Posts: 32
Joined: 06 Aug 2017 16:31

Transmit ASCII character using UART - PIC32MX170F256B.

#1 Post by Skyfall » 06 Aug 2017 16:49

Hi,

Very new to this compiler: Mikrobasic Pro for PIC32. Processor is: PIC32MX170F256B.

Trying to send a text character to a Terminal at 19200.
My processor has no external Crystal, RC network or Oscillator. Using the internal oscillator.

Problem: I'm unsure about the operating frequency of this processor, however I am using a logic probe and see no data coming out the UART at all when I run the code.

Program is:

main:
' CHECON = 0x32
' AD1PCFG = 0xFFFF ' Configure AN pins as digital I/O
ANSELA = 0
ANSELB = 0
UART1_Init(19200) ' Initialize UART module at 19200 bps
Delay_ms(100) ' Wait for UART module to stabilize

UART1_Write_Text("A")
end.


The first two lines do not compile with this processor. Have substituted ANSELA/B to disable ADC in lue of this.

Apart from studying the datasheet further, any help would be appreciated!

Thank you!

hexreader
Posts: 1786
Joined: 27 Jun 2010 12:07
Location: England

Re: Transmit ASCII character using UART - PIC32MX170F256B.

#2 Post by hexreader » 07 Aug 2017 10:40

Project attached.

Tested and working.

EDIT: Just realised that you are using BASIC, not C. (must learn to read more carefully).
Attachment is no good other than to give an idea. I do not have a BASIC compiler.
Attachments
forum.zip
(101.64 KiB) Downloaded 149 times
Start every day with a smile...... (get it over with) :)

hexreader
Posts: 1786
Joined: 27 Jun 2010 12:07
Location: England

Re: Transmit ASCII character using UART - PIC32MX170F256B.

#3 Post by hexreader » 07 Aug 2017 13:01

Made a BASIC version of the program for you.....

Tested and working.
Attachments
forum.zip
(165.73 KiB) Downloaded 154 times
Start every day with a smile...... (get it over with) :)

Skyfall
Posts: 32
Joined: 06 Aug 2017 16:31

Re: Transmit ASCII character using UART - PIC32MX170F256B.

#4 Post by Skyfall » 09 Aug 2017 03:12

Thank you very much for the advice, and time spent putting this together.

The program works well!

All the best...

hexreader
Posts: 1786
Joined: 27 Jun 2010 12:07
Location: England

Re: Transmit ASCII character using UART - PIC32MX170F256B.

#5 Post by hexreader » 09 Aug 2017 11:24

Forgot to say...

Welcome to the forum :)
Start every day with a smile...... (get it over with) :)

Post Reply

Return to “PIC PRO Compilers”