Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:40 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PIC18F46K22 - personal experience

Author Message
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 10:38am 09 May 2014
Copy link to clipboard 
Print this post

I was very excited about this micro when it was available (if it works as expected, can be a reliable alternative to Sanguino board and that means that we can have a working 3D printer with PIC18F!!!). But then, people started screaming on Microchip forums about peripheral problems and my enthusiasm decreased.

But now I'm about to find out myself. The AN1310 (modified behavior) serial bootloader works perfect every time - there are PC applications for it available for all three major operating systems.

The I2C on MSSP1 works well on 100KHz and 400KHz bus speed but on 1MHz speed, after a few succeeded data exchanges, the firmware freezes. I'm testing it with the PCF8583 RTC (and JALv2 compiler with Jallib I2C master hardware libraries) but there is a problem: the 32KHz crystal is way off, as I get 2 hours advance on 3 hours run. It clocks way too fast! Maybe is the RTC at fault (I didn't looked at the datasheet to see if it sustains such a high I2C speed), and not the micro. So, this aspect remains to be solved another time. For me, it is important that the I2C works reliable at those two speeds. In fact, it will remain after night at 400KHz speed to see how it behaves on a long run.

Man, those watches made on a ship in international waters...Edited by vasi 2014-05-10
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 01:54pm 09 May 2014
Copy link to clipboard 
Print this post

I bet that the crystal is running on an overtone. I am not much of an expert on crystals but I understand that, if they are driven incorrectly, they will oscillate on a multiple of their proper frequency. It might be worth experimenting with the padding capacitors.

Geoff
Geoff Graham - http://geoffg.net
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 03:38pm 09 May 2014
Copy link to clipboard 
Print this post

  Geoffg said   they will oscillate on a multiple of their proper frequency.


In FM transmitter work I do, they are often called harmonics, and are unwanted. 1st, 2nd and 3rd harmonics in the analog TV days were a real problem, as if not properly suppressed and filtered, they could be up around the TV band, and cause TV interference - the best and quickest way to get caught and shut down!

I also have no idea about overtone crystals, but I DO remember reading about them during my electronics theory study.


Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 05:19pm 09 May 2014
Copy link to clipboard 
Print this post

The data sheet I have lists the max I2C clock as 100kHz.
The date on my data sheet is 1997 so there is likely to be more up to date info available.

Setting the Chrystal trimmer is usually done by measuring the 1Hz output on the interrupt pin.
Values for the trimmer is likely to between 5 and 25 pF
Any value around those limits may persuade the crystal to behave itself.

Jim
VK7JH
MMedit   MMBasic Help
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 01:13am 10 May 2014
Copy link to clipboard 
Print this post

The datasheet from 2010 is saying the same - 100KHz. It worked ok overnight at 400KHz but I understand this is above specifications and you don't usually do that. I restarted it at 0:00 and now at 13:50, the RTC shows 17:52 - that is how fast is running.

I bought a while ago the right crystal and another PCF (this one is borrowed from the Polish board) along with a trimmer capacitor, but I can't find them...

Anyway, this watch crystal served his purpose: helping me to port the PCF8583 libraries to JALv2 and to test I2C at different speeds. I have to build an I2C LCD to have at least 2 peripherals on I2C bus...
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 02:16am 10 May 2014
Copy link to clipboard 
Print this post

Morning Gents...

One thing that might be causing the problem is the type of X-tal used... The ones used in watches are made to be driven from very low voltage oscillators. The ones made foe RTC chips have higher voltage drive and could easily overdrive the watch types causing the odd harmonics problem...
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 03:33am 10 May 2014
Copy link to clipboard 
Print this post

I've soldered a 22pF cap. on VDD and OSC1 pin and it seems to behave normally. I'm querying it at 500ms on 100KHz I2C speed and it appears to be good. I'll do a test tonight. Or maybe sooner if I modify the firmware to allow me to set the time/date on serial...

_________
Edit: thanks guys, the capacitor cured the RTC problem.Edited by vasi 2014-05-11
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 09:40am 11 May 2014
Copy link to clipboard 
Print this post

Finally, I found the envelopes with the components! Now the AVR evaluation board can get her RTC back. But, I think I want to save the crystal for another project... Anyway, it would be there if something goes wrong again.


There is an obvious difference in size between crystals, that's why I had my doubts at the beginning.
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024