GNUSim8085 is a graphical simulator, assembler, debugger for Intel 8085 microprocessor.It is very helpful for Engineering and Polytechnic students with Microprocessor as a subject.
It is available in Ubuntu and Debian repository
Fedora
SES, SEO, SEM, Linux and Microcontroller Help, News and Experience sharing Blog
"My PIC Microcontroller Articles are moved to http://picmicrochip.blogspot.com
To Initialize a PWM module at 2KHz do this :Pwm_Init(2000);
Pwm_Start and Pwm_Stop are used for starting and stopping PWM .
Pwm_Change_Duty Changes PWM duty ratio. Parameter duty takes values from 0 to 255. It can be calculate using equation (Percent*255)/100. See 0 is 0%, 127 is 50%, and 255 is 100% duty ratio.
Take a look at the following simple program
// microcontroller : P16F877A
// PWM module is set on RC2 Pin No 17.
unsigned short i;
void main() {
PORTC = 00; // Set PORTC to $FF
TRISC = 0; // PORTC is output
Pwm_Init(5000); // Initialize PWM module
Pwm_Start(); // Start PWM
while (1) { // Endless loop
for(i=0;i<=255;i++)
{ Pwm1_Change_Duty(i);
delay_ms(10); }
} }
This program creates a pwm on pin17 of PIC16F877A .Hope you found this tutorial useful .If you have any doubts about the program .Leave a comment . click to enlarge figure. set CRO channel A Volts to 1 V and time/div to 50usunsigned short Eeprom_Read(unsigned int address);
Second Function Eeprom_Write takes two parameters address and data .
See syntax given below .
void Eeprom_Write(unsigned int address, unsigned short data);
See the Example program