element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • 'Choose another store...'
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Pic Microcontrollers Forum PIC18F16Q41 capabilities
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Embedded and Microcontrollers requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 12 replies
  • Subscribers 124 subscribers
  • Views 260 views
  • Users 0 members are here
Related

PIC18F16Q41 capabilities

Bob-M
Bob-M 5 days ago

Hello

My knowledge of electronics is minimal..................

I am looking at a circuit which uses a Rasberry Pi4 to produce two different frequencies on two different GPIO pins (7 & 8)

The two frequencies are read from two simple python scripts

My question:-

Can one program a PIC18F16Q41 chip to do the same i.e. produce two different frequencies on two different IO pins ?

If affirmative, can one program the PIC to accept input from a user to get the two different frequencies, rather than have the PIC read scripts ?

Many thanks for any advice

Bob M

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett 5 days ago in reply to Bob-M +1
    You still aren't defining your problem in such a way that it can be solved: "I am seeking to provide two different frequencies to be mixed e.g. 10Hz and 40Hz, square wave Frequency range:- 1Hz - 4MHz…
  • Bob-M
    Bob-M 1 day ago in reply to Bob-M +1
    Update I have now found Tinkercad...what a brilliant website !!!! I can load up an Arduino UNO R3, reproduce any of the circuits I have been looking at, add code, compile and test, all virtually !…
  • shabaz
    0 shabaz 5 days ago

    Hi,

    There's not enough information, and it's too cryptic for one to guess.

    What's the actual use-case? What is your actual goal?

    That will help provide the context. Next, what sort of frequency range and granularity? Why PIC18F16Q41 specifically?  Given you mention your knowledge of electronics is minimal, why not an off-the-shelf signal generator board - some are cheap.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Bob-M
    0 Bob-M 5 days ago in reply to shabaz

    Hi

    I am seeking to provide two different frequencies to be mixed e.g. 10Hz and 40Hz, square wave

    Frequency range:- 1Hz - 4MHz

    Granularity - I don't know what that means

    Why this PIC ?

    I came across an article about PIC16F1619 being able to deliver specific frequencies to a great degree of accuracy

    I then tried to stay in the same family of PICs but to find a later model, if that makes sense.

    Bob M

    p.s. would you care to suggest an off-the-shelf signal generator board that would satisfy my requirements ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett 5 days ago in reply to Bob-M

    You still aren't defining your problem in such a way that it can be solved:

    "I am seeking to provide two different frequencies to be mixed e.g. 10Hz and 40Hz, square wave

    Frequency range:- 1Hz - 4MHz"

    OK, so you have given us a frequency range:

    now we need to know about:

    • precision - can it be set to within 1%, 1ppm , 0.1Hz or whatever
    • accuracy - when it is set to a frequency then how much error is there - usually specified in ppm (parts per million)
    • drift - once set, how much does it change over time, usually specified in ppm/time interval
    • jitter -  specified in several different ways, sometimes called phase noise (they are related)

    The other way you can spec something is by explaining what you want to do with it - this allows the expert that you ask to use their knowledge to make up for gaps in your own !

    For example - " I want to beat two signals together to make interesting radio interference"

    The best way to ask is to provide as good a spec as you can AND explain the application.

    I would not use a PIC16F for a new design unless I already had parts and a board or had development tools and experience with the part. There are modern parts that are much better and cheaper for small volume work.

    I'm tempted to go further and make some suggestions about generating your signals but long experience teaches me that we'll get  a much better solution if I wait for you to explain the problem in more detail.

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Bob-M
    0 Bob-M 4 days ago in reply to michaelkellett

    Sorry don't need to be obtuse...............

    I am looking at building a diy alpha-stim

    quote.................

    diy ALPH-STIM .5hz waveform microcurrent device by generating 2 different square waves on the pi4's GPIO pins(.5hz & .4hz)(GPiO pins 7 & 8)...each GPiO pin powers a FET OPTOisolator chip by running current through its optoisolator diode, 1 GPiO PiN on the + excursion of the square wave, the the other GPiO on the GROUND cycle of the square wave... when the OPTOisolator diode(s) is(are) powered with current from the GPiO square wave, it releases a 9 volt battery's current to pass through on the other side of the optoisolator...(about 40 ohms of OPTO 'N' material resistance) and then pass through another resistor and then to the 2 Treatment PROBEs ( this is a 1st test run - proof of concept/construction - stage 1) since the output of the GPiO pins square wave is mono-phasic, it only produces ground & +3volts... so an npn/gate transistor will drive the optofet diode on one optoFET chip when its GPiO PiN goes POSITIVE and a PNP/gate transistor will drive the (2nd optofet diode on the 2nd optoFET chip when the square wave goes to ground on its GPio PIN)...on the other side of the optoFETs awaits its 9 volt battery's current to be released, one battery goes from - to +, (on OPTO 1) to PROBE 1, the other battery goes from + to - , (on OPTO 2) to PROBE 2, for a dual microcurrent power supply(the OTHER side of the OPTOs are joined together on 1 connection, the other connection goes to one of the battery terminals on one of the batteries for both OPTOs) for the microcurrent treatment protocols.... the batteries are totally isolated from the pi4's power supply, going through limiting resistors to keep the microcurrent treatment under 1 milliamp....

     https://www.alpha-stim.com/wp-content...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett 4 days ago in reply to Bob-M

    Hello Bob,

    I'm going to stick my neck out here and say that this device is Quack medicine, Snake oil or your preferred derogatory phrase.

    I could be wrong.

    First a warning: be very, very careful when you attach electronics to a human body. I'll tell you a bot about making signals but offer no advice at all at connecting said device to a live human.

    The quote you have provided needs its full context to be useful.

    You can't generate a waveform exactly like that in the alpha-stim document with two square waves.

    It has a base part which looks as if it might be possible to generate by gating two square waves together but the rising amplitude spikes would need a more complex design.

    The frequencies are very low, which helps:

    The simplest way to make a waveform like this would be to make a low frequency Arbitrary Waveform Generator which you could do with an Arduino (you would need to select one with a DAC). You then write some code that sends out a new sample (defining the amplitude of the signal) maybe once every few ms and it would be quite easy to replicate the waveform.

    SO I think you would get some answers by searching for Arduino Arbitrary Waveform Generator or maybe Arduino DAC.

    You would still have work to do to get to a thing driving current through your brain - if you want my comments on the diy quote you'll need to give me a link to it - without the diagrams and with just a fragment of it I can't make sense of it.

    Please be aware that my helping you to make signals in no way endorses the idea of injecting them into brains (your own or any one else's.).

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Bob-M
    0 Bob-M 4 days ago in reply to michaelkellett

    Hi

    Thank you so much for replying and thank you for sticking to my questions as such:.....................

    image

    The above is one of several like diagrams

    www.youtube.com/watch

    Bob M

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Bob-M
    0 Bob-M 4 days ago in reply to Bob-M

    googled "Arduino Arbitrary Waveform Generator"...............

    projects available using

    1) DUE

    2) UNO

    3) Mega 2560 R3

    still have difficulty in understanding which of the above would be suitable ??

    Bob M

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dougw
    0 dougw 4 days ago in reply to Bob-M

    The UNO R4 Minima is fast and it has a DAC.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Bob-M
    0 Bob-M 4 days ago in reply to dougw

    Thank you Doug for your advice

    I see the UNO R4 Minima is $NZ37.35...at Element14...........a good price !

    Can you generate two frequencies to two IO pins ?

    Bob M

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Bob-M
    0 Bob-M 4 days ago in reply to Bob-M

    Here's another circuit diagram.................

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube