+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Newbie level 3
    Points: 28, Level: 1

    Join Date
    Apr 2019
    Posts
    4
    Helped
    0 / 0
    Points
    28
    Level
    1

    Running program/code for pwm dimming and usart pic18f87j10

    HELLO EVERYONE,
    CAN ANYONE PLEASE HELP ME(PROVIDE) THE RUNNING CODE OF PWM DIMMING AND USART SERIAL COMMUNICATION FOR CONTROLLER PIC18F87J10 AND PIC18F87K22
    I HAVE TRIED ALMOST EVERYTHING FROM MY SIDE AND ALSO TOOK HELP FROM OTHERS BUT NOT GETTING THE OUTPUT PROBABLY DUE TO SOME SYNTAX OR ANY OTHER ISSUE.

    KINDLY HELP WITH THIS ASAP
    Last edited by andre_teprom; 15th April 2019 at 12:49. Reason: removed BOLD formatting

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 79,232, Level: 68
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,979
    Helped
    4332 / 4332
    Points
    79,232
    Level
    68

    Re: Running program/code for pwm dimming and usart pic18f87j10

    We need to know a lot more about what your requirements are. What method of PWM dimming, what the power source and load are, what serial speed and protocol?
    If you give us some idea of what you have done already and tell us what language/compiler you are using it would help.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  3. #3
    Newbie level 3
    Points: 28, Level: 1

    Join Date
    Apr 2019
    Posts
    4
    Helped
    0 / 0
    Points
    28
    Level
    1

    Re: Running program/code for pwm dimming and usart pic18f87j10

    Basically the PWM provided from the microcontroller turns on/off a MOSFET which controls the passage of current through LEDs, thus controlling their brightness. The original circuit is bit complex and big. We are using IC LM3424 by Texas Instruments to reduce the input voltage of 32V to 11V in the output, that's the load requirement so the PWM generated from the microcontroller goes into the LM3424 and is produced/reflected as it is on the other end, where it controls the MOSFET placed in parallel with the load.
    All we want to know, is the C language code for PIC 18F87J10 and PIC18F87K22, to generate a PWM with default frequency, or with a frequency of around 1 kHz if customization is possible and for the serial communication via UART baud rate 9600 for 16 BIT VALUE. For programming PIC, we are using MPLAB X v5.15 with XC8 compiler and PICkit 3 and EXPLORER 8 DEVELOPMENT BOARD.

    please help us with the PROPER RUNNING CODE/PROGRAM rather than the tutorials or function sort etc. , we will be highly obliged.

    for errors : many warnings and errors were generated regarding functions used (will try to show screen shots soon) and they were not going by doing 'n' number of amendments so the last option was to delete it, which fails our operation. The codes were basically for PIC16F family and few PIC18F family . so we think like syntax issue etc. also while we tried for MCC generation
    so kindly send MCC (if using) project package with the running program written in it if possible.
    soon reply will be appreciated



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 74,732, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,164
    Helped
    3450 / 3450
    Points
    74,732
    Level
    66

    Re: Running program/code for pwm dimming and usart pic18f87j10

    Hi,

    This simply means you want others do your job.
    I wouldn´t be surprised if you ask for hardware design, whardware and money, too.

    ****
    It seems you misunderstand how a forum works.

    Mayn people here are willing to help you to rectify problems, This means you first have to do your job.
    * deciding specifications
    * drawing hardware schematics or even draft about your hardware connections.
    * drawing a flow chart for the software
    * deciding serial protocol
    * writing the software on your own
    * showing us the error informations of the compiler
    * show us your code

    in case of the hardware/code does´t work like expected:
    * tell us your test conditions
    * tell us your expectations
    * tell us what is not like expected

    Don´t get me wrong: We are will to help ... for free.
    But if you want others to do your job then consider to pay them.


    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  5. #5
    Newbie level 3
    Points: 28, Level: 1

    Join Date
    Apr 2019
    Posts
    4
    Helped
    0 / 0
    Points
    28
    Level
    1

    Re: Running program/code for pwm dimming and usart pic18f87j10

    This simply means you want others do your job.
    sorry but i think you took it wrong. but the thing is ,the project is a R&D project(HIGHLY CONFIDENTIAL), various factors have been done and analyzed but we got stuck into this so was seeking help as we have tried a lot before coming to EDABOARD FORUM AND EXPECTING SUCH REPLY from many other sites and users EVEN FROM THE MANUFACTURER'S FORUM, well leave thanks for the support and also for all the stuff you asked , for many we are not authorized to share, so we just asked for the code if someone had already tried .

    thank you



  6. #6
    Super Moderator
    Points: 79,232, Level: 68
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,979
    Helped
    4332 / 4332
    Points
    79,232
    Level
    68

    Re: Running program/code for pwm dimming and usart pic18f87j10

    All you need to do is follow the formulas for setting the TMR2 rate for ~1KHz and setting the PWM value in the other registers between 0 and 255. The PWM module will produce the signal you want on the output pin. The registers and bits you need to set are detailed in the data sheets. Once set, the PWM output runs by itself until you change the settings or disable it. To calculate the values you first need to know the clock frequency as everything is derived from it.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisement

        
       

  7. #7
    Advanced Member level 4
    Points: 7,549, Level: 20

    Join Date
    Jan 2015
    Posts
    1,063
    Helped
    333 / 333
    Points
    7,549
    Level
    20

    Re: Running program/code for pwm dimming and usart pic18f87j10

    Looks like the OP has gone but the funny thing is that he was asking for code and there are many examples of code that he could have used on the Internet.
    Of course the trick is to split the task into two: UART communication and PWM generation. The UART part is mainly done by the hardware but then he will probably have to parse the values that have been received - not hard in itself but without details (which are apparently highly secret) it is hard to point to any existing code there might be.
    The PWM task has been solved multiple times. If only he dropped the MOSFET driving idea for a while to get a directly connected LED to do what he wanted. Once that is going then put back in the MOSFET circuit.
    By the sound of it, this was for a commercial organisation - my guess is that they might get the sack for such obvious lack of basic knowledge; or the company is too cheap to give them some basic training etc...
    Susan



--[[ ]]--