CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

OLED driver works at 32 MHz but not at 64 MHz
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Nov 23, 2017 7:48 am     Reply with quote

Just as a FYI, I've put together a 46K80, and done a basic software I2C test to a device on the bench here. Runs fine at both 32MHz, and 64Mhz. At 64, the clock timing was about 1% faster than at 32MHz, but still just under 100K.
The library is fine (5.075).
However I can make it hang, if the RB7 line does not go high properly.
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 7:50 am     Reply with quote

Compiler version Latest - 5.075

Tried with older versions as well same result.
_________________
Johan Pretorius
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Nov 23, 2017 7:51 am     Reply with quote

So back to the questions we have already asked about your hardware.
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 7:55 am     Reply with quote

I use 2k pullup to 3V3. Let me flash LED in main loop. Now on timer interrupt.
This is making me crazy, He He.
_________________
Johan Pretorius
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 7:57 am     Reply with quote

Maybe I must move pullup closer to OLED. Now connected with 4 wires about 20cm Long. I will look at shortening the wires.
_________________
Johan Pretorius
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Nov 23, 2017 7:58 am     Reply with quote

2K is 'upper end' of the range for 3.3v, but should be OK at 100K.
However the big questions are about the decoupling and supplies to the chip.
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 8:00 am     Reply with quote

Let me decrease the resistance to 1K5. I'll give feedback.
_________________
Johan Pretorius
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 8:02 am     Reply with quote

I have 100nF decouling close to each chip on the board. The display has no decoupling maybe I can add cap on the power pins on the display.
_________________
Johan Pretorius
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 8:55 am     Reply with quote

Really does not make sense. I lowered the resistors to 1K5 I added extra capacitors and I remover the 20cm cable. Same result, work with 32MHz and not with 64MHz. Also checked with LED in main loop program is running.
_________________
Johan Pretorius
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Nov 23, 2017 9:13 am     Reply with quote

The chip requires at least two such capacitors, _and_ a 10uF low ESR capacitor on the Vcap pin. This latter is vital. The chip runs internally on only about 1.8v, and this capacitor stabilises the regulator that feeds the core.
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 9:36 am     Reply with quote

Have 10uF on Vcap for pic and 1 x 100nF and 1 x 1uF
_________________
Johan Pretorius
johanpret



Joined: 23 Oct 2006
Posts: 33
Location: South Africa

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 23, 2017 9:39 am     Reply with quote

I will try on different pic PIC18F26K40 and Pic18F67K22.
_________________
Johan Pretorius
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Nov 23, 2017 11:04 am     Reply with quote

johanpret wrote:
Have 10uF on Vcap for pic and 1 x 100nF and 1 x 1uF


Good.
Do you have a part number for this capacitor?.
It is so vital, and the problem is that if (for instance) the ESR is high, it can lead to erratic behaviour particularly when the speed increases...
Is the chip actually on a PCB?.
Good ground plane?.
dyeatman



Joined: 06 Sep 2003
Posts: 1910
Location: Norman, OK

View user's profile Send private message

Did I miss something?
PostPosted: Thu Nov 23, 2017 11:20 am     Reply with quote

The question was asked early on to verify the chip is actually running at 64mhz but I didn't see an answer.... is it confirmed to be at 64mhz with the led/scope test?
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Nov 23, 2017 11:29 am     Reply with quote

Agreed.
This should be the first test.
However I've seen these chips work OK, for a really basic test, and then go screwy, when you actually run more complex code.
Something like an LED flasher, together with a simple serial send/receive, and I'd start to be happy... Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group