It is currently 23 Feb 2019 13:48

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 15 Jan 2019 11:24 
Offline

Joined: 18 Feb 2017 16:27
Posts: 4
Hi Guys, my first time posting in the forum so please be gentle with me.
I'm pulling my hair out with an apparently simple task of reading a ds18b20 on portb.10 of an P32MX534F064H clicker board.

Setup:
4k7 pullup attached to portb.10 DQ line from the 3v3 supply. (i've also tried various other values)
JTAG is disabled.
Code is identical to Mikroe sample code which works fine on a PIC18F clicker 2 board


Problem:
I can get the readings out of the ds18b20 when running the primary oscillator at 8Mhz with no PLL only if i put a resistor >10k to 0V on the DQ line. (very strange)
If i speed things up using the PLL it gets progressively worse the faster it goes. i.e corrupt readings.
I put a one wire analyser on the DQ line and that confirmed the faster i ran the processor the more invalid instructions the analyser was detecting.
Trien another clicker board just in case - same thing.

My question is ....... Is their anything i'm doing wrong with the configuration of portb.10 on the P32MX534F064H ?
Is the port not pulling the DQ line to 0V

Any help would be much appreciated. :roll:


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

Joined: 14 May 2018 08:34
Posts: 354
Hi,

It sounds like your oscillator settings are wrong.
Could you zip and attach your project here please?

Kind regards,

_________________
Filip Grujcic


Top
 Profile  
 
PostPosted: 17 Jan 2019 11:17 
Offline

Joined: 18 Feb 2017 16:27
Posts: 4
Thanks Filip for you reply.
Its my first time using 32 bit PIC'S so you are probably correct about the oscillator settings.
I've attached my project. It's far from finished - needs a lot of cleaning up.
Many Thanks
Andy


Attachments:
32Bit Mini O2.zip [36.42 KiB]
Downloaded 7 times
Top
 Profile  
 
PostPosted: 17 Jan 2019 16:28 
Offline
User avatar

Joined: 14 May 2018 08:34
Posts: 354
Hello,

On the screenshot below you can see how to set up your oscillator bits for 80 MHz PLL (the ones marked with red arrow are the ones relevant for oscillator settings).
I will also attach a config scheme file which you can load from the Edit Project window.

Kind regards,


Attachments:
P32MX534F064H_-_80MHz.zip [933 Bytes]
Downloaded 5 times
Screenshot_1.jpg
Screenshot_1.jpg [ 160.97 KiB | Viewed 88 times ]

_________________
Filip Grujcic
Top
 Profile  
 
PostPosted: 18 Jan 2019 14:31 
Offline

Joined: 18 Feb 2017 16:27
Posts: 4
Thanks for that. It's confirmed settings i have previously used. The Soft UART works perfectly well using all combinations of PLL / frequency, unfortunately the DS18B20 is being an utter pain. I'm being drawn to a problem with the setup of portb.10. Maybe i'm missing something in the data sheet. I'll spend some time on it over the weekend and scope out the port pin to ge a clearer understanding of what is actually happening. I'll also try shifting the DQ line on to another port bit.
Many Thanks for your help Filip


Top
 Profile  
 
PostPosted: 18 Jan 2019 16:10 
Offline

Joined: 18 Feb 2017 16:27
Posts: 4
I couldn't wait for the weekend :D
I've put a scope on the DQ line and shifted it to RD9. The scope shows pretty much the same thing at any speed, quite a bit of ringing when the pulse hits zero volts. I'm experiencing the same problem. At 8MHz HS xtal using no PLL it works fine. If i increase to 10 MHz using PLL Multiplier at 15 and PLL input divider at 12 I manage to get intermittent values returned. The higher the speed the less readings i get back from the DS18B20.
I don't suppose you would like to dump my program into a PIC32MX clicker with an ADC 6 plugged in and a DS18B20 running on 3.3V with the DQ line on RD9 to prove i'm not insane.
Thanks
Andy


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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: