It is currently 23 Apr 2019 21:35

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 12 Dec 2018 01:41 
Offline

Joined: 29 Mar 2017 21:19
Posts: 23
I've likely missed something simple but so far with both the LM35 and ADC examples on a fusion v7 neither of them will work.
They work fine with the 512L chip so it's not the board.

First thing tried was changing AD1PCFG to ANSEL and also the port direction as appropriate.
It still reads 0 on the LM35 example and does not change the port d leds in the ADC example.
I'd hate to kill a port by mis-configuring and exceeding voltage levels.

BTW, the DS1820 digital temp works great with minor changes:
ANSELA = 0;   //EFH144 A ports as digital
TRISA = 0;   //EFH144 configure A ports as outputs
//AD1PCFG = 0xFFFF;            // Configure AN pins as digital I/O - comment this out


Has anyone gotten ADC or LM35 to work with a P32MZ2048EFH144 chip?
Thanks

_________________
Windows 7 & 10 64 bit
EasyPIC Pro v7 with PIC18F87J60, PIC18F87K22
EasyPIC Fusion v7 with PIC32MZ2048EFH144, PIC32MX795F512L
Flip & Click with P32MZ2048EFH100
Easy TFT, GLCD, 7" TFT


Top
 Profile  
 
PostPosted: 16 Jan 2019 15:45 
Offline
User avatar

Joined: 05 Mar 2018 09:44
Posts: 607
Location: Belgrade
Hi Colin,

I apologize for the late reply.

Here's the updated ADC library for PIC32MZ MCU and the ADC example for the PIC32MZ2048EFH144 that works.

Put the library in the Uses sub folder in the mikroC PRO for PIC32 installation folder and recompile the example.

Kind regards,
Petar


Attachments:
PIC32MZ2048EFH144_ADC.7z [222 KiB]
Downloaded 25 times
Top
 Profile  
 
PostPosted: 21 Jan 2019 21:25 
Offline

Joined: 29 Mar 2017 21:19
Posts: 23
No worries about a late reply, I was able to get most of the stuff working with the MX795 chip so testing and learning wasn't delayed.
It will be nice to set it up on the more capable EFH144 chip though.
Thanks again!

_________________
Windows 7 & 10 64 bit
EasyPIC Pro v7 with PIC18F87J60, PIC18F87K22
EasyPIC Fusion v7 with PIC32MZ2048EFH144, PIC32MX795F512L
Flip & Click with P32MZ2048EFH100
Easy TFT, GLCD, 7" TFT


Top
 Profile  
 
PostPosted: 22 Jan 2019 12:08 
Offline
User avatar

Joined: 05 Mar 2018 09:44
Posts: 607
Location: Belgrade
Hi Colin,
You're welcome,
Kind regards,
Petar


Top
 Profile  
 
PostPosted: 19 Feb 2019 18:55 
Offline

Joined: 19 Feb 2019 18:33
Posts: 2
Hello
I have same problem I purshed easypic v7 with mcu pic32mz2048ech144
I have problem in using UART port to communicate with computer so please I need help.
:oops:


Top
 Profile  
 
PostPosted: 08 Mar 2019 00:05 
Offline

Joined: 29 Mar 2017 21:19
Posts: 23
Hi naser,
Sorry for my late reply, only recently returned home after a long work trip abroad. It makes it difficult to answer the very few forum questions with which I may be able to help.
Have a look at this post:
https://forum.mikroe.com/viewtopic.php?f=164&t=67457&p=274337&hilit=mz+uarta#p274337

It covers the MZ UART and a lot more, it has a download which has code for Peripheral Pin Select settings which looks like (cut from the download):

Unlock_IOLOCK();

  PPS_Mapping(_RPF5, _OUTPUT, _U1TX);   // Sets pin PORTC.B6 to be Output and maps UART1 Transmit to it
  PPS_Mapping(_RPF4, _INPUT, _U1RX);    // Sets pin PORTC.B7 to be Input and maps UART1 Receive to it

  Lock_IOLOCK();


I'm not too sure about the accuracy of the comments but basically the MZ line needs to be told where to find peripherals, makes it easy to place components when designing a board but it's confusing swapping between chips on the fusion. Reference the data sheet to find your PPS settings for the ECH chip and hopefully it'll work for you. Good luck.

_________________
Windows 7 & 10 64 bit
EasyPIC Pro v7 with PIC18F87J60, PIC18F87K22
EasyPIC Fusion v7 with PIC32MZ2048EFH144, PIC32MX795F512L
Flip & Click with P32MZ2048EFH100
Easy TFT, GLCD, 7" TFT


Top
 Profile  
 
PostPosted: 26 Mar 2019 17:15 
Offline

Joined: 11 Nov 2017 04:35
Posts: 10
Dears

Let me please clarify something. If the attached example we are:
    setting ANSELB = 0x0100 and TRISB8_bit = 1 means operate with RB8;
    getting sample as ADC1_Get_Sample(0) from AN0 which is RB0 as per datasheet.

Am I missing something?

Thanks.


Top
 Profile  
 
PostPosted: 27 Mar 2019 14:19 
Offline
mikroElektronika team
User avatar

Joined: 18 Dec 2018 10:36
Posts: 216
Hello,

According to the datasheet of PIC32MZ2048EFH144 MCU (page 12), RB0 pin is used for channel AN0.
http://ww1.microchip.com/downloads/en/D ... 01320F.pdf
So you should set RB0 pin instead of RB8 as Analog Input

Please find an example in the attachment

Kind regards,
Jovana


Attachments:
ADC_PIC32MZ2048EFH144.zip [388.19 KiB]
Downloaded 6 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] 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: