Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Running program/code for pwm dimming and usart pic18f87j10

Status
Not open for further replies.

VAIBHAV_PRODIGY

Newbie level 3
Newbie level 3
Joined
Apr 15, 2019
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
48
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:roll:
 
Last edited by a moderator:

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.
 

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
 

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
 

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
 

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.
 

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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top