Sunday, February 28, 2010
Saturday, February 27, 2010
hiddemo.exe and OScope.exe
this file is compatible with the example ex_usb_hid.c which is mentioned in ccs:
CCS DELPHI HOST DEMO
CCS DELPHI HOST DEMO
USB test with pic18f4550
just program .hex file to the chip the code was written in mcc18 :
Generic HID pic side
Generic HID pc side
Friday, February 26, 2010
Lcd Hello World pic18f4550
here is ccs code :
#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
#include
void main() {
lcd_init();
lcd_putc("Hello!");
}
LCD pins D0-D3 are not used and PIC D3 is not used.
D0 enable
D1 rs
D2 rw
D4 D4
D5 D5
D6 D6
D7 D7
strange errors in ProgICD2
I prefer using mplab programmer itself but inorder to program pic 16f84 there is no other choice.
LED Blink pic18f4550
here is the code written in ccs :
#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
void main() {
while (TRUE) {
output_high(PIN_D1);
delay_ms(500);
output_low(PIN_D1);
delay_ms(500);
}
}
remeber to select PCH 16 bit to compile
pin1 ---> vcc
pin11 ---> vcc
pin12 ---> gnd
pin13 & pin14 ---> crystal + 20pf capacitor
pin20 ---> led+resistor(470 ohm)
pin31 ---> gnd
pin32 ---> vcc
#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
void main() {
while (TRUE) {
output_high(PIN_D1);
delay_ms(500);
output_low(PIN_D1);
delay_ms(500);
}
}
remeber to select PCH 16 bit to compile
pin1 ---> vcc
pin11 ---> vcc
pin12 ---> gnd
pin13 & pin14 ---> crystal + 20pf capacitor
pin20 ---> led+resistor(470 ohm)
pin31 ---> gnd
pin32 ---> vcc
Thursday, February 25, 2010
Lcd Hello World pic16f84a
here is the mikroC code:
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections
char *text = "Hello World"; //Constant holding text to be displayed
void main() //Main program
{
TRISB = 0; // PORTB is output
Lcd_Init(); // Initialize LCD connected to PORTB
Lcd_Cmd(_Lcd_CLEAR); // Clear data on lcd
Lcd_Cmd(_LCD_CURSOR_OFF); // Turn cursor off
while(1) //while loop, not necessarily needed
{
PORTA = ~PORTA;
Lcd_Out(1, 1, text); // Print text to LCD, 2nd row, 1st column
}
}
LED Blink pic16f84a
here is the mikroC code :
void main() {
PORTB = 0;
TRISB = 0;
while (1) {
PORTB = ~PORTB;
Delay_ms(100);
}
}
and
pin4 ---> vcc
pin5 ---> gnd
pin9 ---> led+resistor(470 ohm)
pin14 --->vcc
pin15 & pin16 ---> crystal + 20pf capacitor
void main() {
PORTB = 0;
TRISB = 0;
while (1) {
PORTB = ~PORTB;
Delay_ms(100);
}
}
and
pin4 ---> vcc
pin5 ---> gnd
pin9 ---> led+resistor(470 ohm)
pin14 --->vcc
pin15 & pin16 ---> crystal + 20pf capacitor
Tuesday, February 23, 2010
Friday, February 19, 2010
how to run your webcam
Skype
Go to main menu, System, Preferences, Menus: Applications, Internet, Items: Skype, Properties, and replace the Command with
bash -c 'LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype'
Go to main menu, System, Preferences, Menus: Applications, Internet, Items: Skype, Properties, and replace the Command with
bash -c 'LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype'
Subscribe to:
Posts (Atom)