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 CCS Technical Support

CLC for JK FLIPFLOP

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
guy



Joined: 21 Oct 2005
Posts: 297

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

CLC for JK FLIPFLOP
PostPosted: Wed Aug 31, 2022 2:10 pm     Reply with quote

(PIC16F18855)

Hi! I want to use the NCO with a clock half the speed of HFINTOSC. For this I want to use the CLC set up as a JK FLIPFLOP (freq. divider).
Configuring the CLC correctly seems impossible... Confused

If someone can post the setup code I would highly appreciate it.
Thanks!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Wed Aug 31, 2022 11:41 pm     Reply with quote

This thread:
[url]
https://www.ccsinfo.com/forum/viewtopic.php?t=55128
[/url]

Has a CLC being setup as a flip flop.
Wrong clock source for you, but this is only the input selection.
Should give a good clue as to how to do this.
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Thu Sep 01, 2022 1:30 am     Reply with quote

Reading on, slightly puzzled. A divider would normally be done with a D
flip flop, not a JK flip flop.
You simply feed it's output inverted back to it's input and clock it from
your source clock. It's output then inverts every clock cycle. Result /2.
guy



Joined: 21 Oct 2005
Posts: 297

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

PostPosted: Thu Sep 01, 2022 1:04 pm     Reply with quote

Ttelmah wrote:
Reading on, slightly puzzled. A divider would normally be done with a D
flip flop, not a JK flip flop.
You simply feed it's output inverted back to it's input and clock it from
your source clock. It's output then inverts every clock cycle. Result /2.


Thank you Ttelmah, it only goes to show I'm no expert... I wouldn't know how to configure it that way, I just want to move on with the project.
Any help would be appreciated.
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Thu Sep 01, 2022 10:25 pm     Reply with quote

No, actually this is historical.
In the first days of logic gates, JK flip flops were the first ones introduced.
They also involve one less gate than D flip flops. So the earliest books use
JK's for everything. However once D's became common, for dividers they
'took over'. For the CLC, either can be done, and there are less connections
to setup to use the D. Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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