free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems
hi sorry to trouble u again... but my teacher is asking me to do RGB LED on the pwm.. may i know if this code works with the RGB and if it don't where should i make improvment on..
and for the prescale and postscale on the timer.. i don really get it.. cuz i change the value of the scales and test on the board.. i don find any different.. plz enlighten me ..
i am using the same board and pic... the board is picdem2 plus demo board 2006 version and pic is p18f4520... i read the data sheet and only see 2 pwm output for this chip so the RGB cannot be done?
you can use 1 PWM and switch between RGB colors to have different PWMs for every LED.
I believe your first step should be generating PWM and changing dimmness of LED through PWM. then you can move further to control individual colors. www.rickeyworld.info If you feel satisfied with the user's forum reply please click on the thank button.
i did the dimming already... but how do i get different pwm for every led? by using 1 pwm signal? fyi i dont know how to use interrupt command so.. if there is a need plz give me a sample and a brief explanation if possible
there are no interrupt commands, they are called interrupt service routines and they are like small functions which are called automatically when your controller is interrupted by an event. and they have fixed addresses so processor know where to jump when any specific event comes.
all you have to do is.. switch to PWM to different pins.. where you LEDs are connected. Its the same way like you do with 7-segment display. select RED LED generate PWM for it then switch to Green then blue. www.rickeyworld.info If you feel satisfied with the user's forum reply please click on the thank button.
#pragma is a compiler directive and run during preprocess of your code compilation.. it used to define options for a specific function or variable or whole program.
lets say in PIC you can define variable in its own udata space. This is needed if your variable is big and not fitting in predefined data space.
CODE:
#pragma udata _myvariable unsignedchar abc[250];//a big variable #pragma udata
so this way while compilation pragma tells compiler that specific option is provided for this variable.
there are many options you can specify with #pragma, just look into "Help" of C18 compiler or whatever compiler you are using. www.rickeyworld.info If you feel satisfied with the user's forum reply please click on the thank button.
8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems