It is currently 20 Apr 2018 15:37

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 06 Aug 2017 16:49 
Offline

Joined: 06 Aug 2017 16:31
Posts: 14
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!


Top
 Profile  
 
PostPosted: 07 Aug 2017 10:40 
Offline

Joined: 27 Jun 2010 12:07
Posts: 895
Location: England
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 58 times
Top
 Profile  
 
PostPosted: 07 Aug 2017 13:01 
Offline

Joined: 27 Jun 2010 12:07
Posts: 895
Location: England
Made a BASIC version of the program for you.....

Tested and working.


Attachments:
forum.zip [165.73 KiB]
Downloaded 55 times
Top
 Profile  
 
PostPosted: 09 Aug 2017 03:12 
Offline

Joined: 06 Aug 2017 16:31
Posts: 14
Thank you very much for the advice, and time spent putting this together.

The program works well!

All the best...


Top
 Profile  
 
PostPosted: 09 Aug 2017 11:24 
Offline

Joined: 27 Jun 2010 12:07
Posts: 895
Location: England
Forgot to say...

Welcome to the forum :)


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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: