pia-468x60

pia-728x90

Thursday, January 15, 2026

FT232R AVR Programmer with AVRDude

If we have a FT232R FTDI chip we can use it as a DIY AVR ISP AVRDude IDE. Because the AVRDude support many ISP hardware. It use software bit-banging to program the AVR chip. However we need a FT232R USB to Serial module that has all its I/O pins.

FT232R AVR Programmer with AVRDude
AVRDude IDE

Then we check the "avrdude.conf" file its installation directory and and then open it in a notepad editor. 

FT232R AVR Programmer with AVRDude
avrdude.conf file

In this file search for the "#ft232r".

FT232R AVR Programmer with AVRDude
the avrdude.conf file

On the ATMega16 AVR Development Board connects the wires as follow.

ATMega16                 FT232R Module

Pin    Name                    ISP

6        PB5(MOSI)        RxD

7        PB6(MISO)        RTS

8        PB7(SCK)          TxD

9        RESET                DTR

10        VCC                VCC

11        GND                GND

 

On the AVRDude IDE click on detect button the software will recognize the target chip. Choose any hex file for your avr chip and write to the device. it works fine except reading and saving file to the disk.

FT232R AVR Programmer with AVRDude
AVRDude IDE

I tested a LED blink file on the ATMega16.

FT232R AVR Programmer with AVRDude

FT232R AVR Programmer with AVRDude


            






Tuesday, December 30, 2025

PIC18F4550 ds18B20 16x2 LCD Example

The ds18B20 is a digital one-wire temperature sensor. It can converts between -55 and +125 Degree Celsius. It has three pins, GND, Data and GND. Its open-drain data pin need an additional pullup resistor with a resistance between 4.4 kOhm and 10kOhm.

PIC18F4550 ds18B20 16x2 LCD Example


This popular digital thermometer is widely used among electronics hobbyist due to its low cost, simple communication and rich of libraries (especially Arduino). The MCU just use its digital I/O pin to communicate with this sensor.

Some C compilers for PIC micro-controller like MikroC and CCS PICC have their libraries to interface with this device. However I prefer CCS PICC here due to its simplicity. 

PIC18F4550 ds18B20 16x2 LCD Example
Program Simulation 1

PIC18F4550 ds18B20 16x2 LCD Example
Program Simulation 2

In this example the PIC18F4550 read the temperature data from ds18B20 via RB4 pin. The temperature data will display on the on-board 16x2 character LCD. The PIC18F4550 clock at its maximum frequency of 48MHz.


  1. #include <18F4550.h>
  2. #DEVICE ADC = 10
  3. #fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
  4. #use delay(clock=48000000)
  5. #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
  6. #define PIN_DS18B20_DATA PIN_B4
  7. #include <ds18b20.c>
  8. #define LCD_ENABLE_PIN PIN_D3
  9. #define LCD_RS_PIN PIN_D2
  10. #define LCD_DATA4 PIN_D4
  11. #define LCD_DATA5 PIN_D5
  12. #define LCD_DATA6 PIN_D6
  13. #define LCD_DATA7 PIN_D7
  14. #include "lcd.c"
  15. #define lcd_clear() lcd_putc('\f')
  16. void main(){
  17. signed int16 val;
  18. printf("\n\rPIC18F4550 DIY USB Prototype Board.");
  19. printf("\n\rWednesday 03 September 2025");
  20. printf("\n\rds18B20 one-wire Temperature Sensor Example\n\r");
  21. printf("\r\n\r\ds18b20.c - ds18B20 example starting\r\n\r\n");
  22. ds18b20_init();
  23. lcd_init();
  24. lcd_clear();
  25. printf(LCD_PUTC,"PIC18F4550 LCD\nds18b20 Example");
  26. delay_ms(5000);
  27. lcd_clear();
  28. while(1){
  29. ds18b20_read(&val);
  30. printf("temperature = %ldC\r\n", val/(signed int16)16);
  31. lcd_gotoxy(1,1);
  32. printf(LCD_PUTC, "Temperature:\n%ld%cC",val/(signed int16)16,223);
  33. delay_ms(2000);
  34. }
  35. }

Click here to download this example.

This PCB is offered by PCBWay since it's a sponsor project. PCBWay is a long term and well known one-stop service provider including PCB fabrication, PCB assembling (PCBA) etc. Their service and price are reasonable. Beside their standard PCB they offer advanced PCB, flex PCB, CNC parts and 3D printing parts.

DIY PIC18F4550 Prototype Board



Most of PCBs are fabricated within 24 hours with a few days of delivery time. All PCB are checked and verify before sending to fabrication process (pre-production check). Their engineer contact us very soon if their are any problem or doubt.

PCBWay also offer a low cost PCB fabrication of the size 10cmx10cm. We can order it between 5 and 10 units for only 5USD. They are standard double sided PCB with solder mask, silkscreen, circuit testing etc.

DIY PIC18F4550 Prototype Board


For a large scale demand we can order their PCB assembly service at reasonable price for any projects.

DIY PIC18F4550 Prototype Board


Monday, December 29, 2025

PIC18F4550 DHT-11 LCD CCS Example

The DHT-11 is an environmental sensor converting surrounding temperature and humidity data. It send these data via its digital bi-directional I/O pin. This sensor has only three pins, VCC(+5VDC), Data and GND. Its data pin is an open-drain output that need an external pullup resistor between 4.7kOhm to 10kOhm.

PIC18F4550 DHT-11 LCD CCS Example

It's very popular due to its low cost and ease of use. Many micro-controller can communicate with this device using its digital I/O pin with software bit-banging for data transmission and reception. Many C compiler including Arduino has a variety libraries for this sensor. CCS PICC also has its driver for communicating with this device using a few line of code. Its new compiler version includes the "dht11.c" driver.

Some good programmers use the Assembly language or even XC compiler to write their own routine communicating with this sensor.

PIC18F4550 DHT-11 LCD CCS Example
Proteus Simulation #1

PIC18F4550 DHT-11 LCD CCS Example
Proteus Simulation #2

Proteus has a model for this sensor that we can easily test our program without wiring all components on breadboard.


  1. #include <18F4550.h>
  2. #DEVICE ADC = 10
  3. #fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
  4. #use delay(clock=48000000)
  5. #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
  6. #define LCD_ENABLE_PIN PIN_D3
  7. #define LCD_RS_PIN PIN_D2
  8. #define LCD_DATA4 PIN_D4
  9. #define LCD_DATA5 PIN_D5
  10. #define LCD_DATA6 PIN_D6
  11. #define LCD_DATA7 PIN_D7
  12. #include "lcd.c"
  13. #include <dht11.c>
  14. #define lcd_clear() lcd_putc('\f')
  15. void main(){
  16. unsigned int8 relativeHumidity;
  17. unsigned int8 tempC;
  18. printf("\n\rPIC18F4550 DIY USB Prototype Board.");
  19. printf("\n\rWednesday 23 September 2025");
  20. printf("\n\rDHT-11 Humidity Sensor Example\n\r");
  21. printf("\r\n\r\dht-11.c - DHT11 example starting\r\n\r\n");
  22. dht11_init();
  23. lcd_init();
  24. lcd_clear();
  25. printf(LCD_PUTC,"PIC18F4550 LCD\nDHT-11 Example");
  26. delay_ms(5000);
  27. lcd_clear();
  28. while(1){
  29. dht11_read(&relativeHumidity, &tempC);
  30. printf("HUMIDITY=%03u%%, TEMPERATURE=%02uC\r\n", relativeHumidity, tempC);
  31. lcd_gotoxy(1,1);
  32. printf(LCD_PUTC, "Humidity: %03u%%\nTemperature:%02u%cC",relativeHumidity,tempC,223);
  33. delay_ms(2000);
  34. }
  35. }

PIC18F4450 read, displays the environmental data on LCD and sending it over serial port every two seconds. I use its maximum 48MHz clock frequency to get a precise timing.

PIC18F4550 DHT-11 LCD CCS Example
Experiment On Bread Board

This PCB is offered by PCBWay since it's a sponsor project. PCBWay is a long term and well known one-stop service provider including PCB fabrication, PCB assembling (PCBA) etc. Their service and price are reasonable. Beside their standard PCB they offer advanced PCB, flex PCB, CNC parts and 3D printing parts.

DIY PIC18F4550 Prototype Board



Most of PCBs are fabricated within 24 hours with a few days of delivery time. All PCB are checked and verify before sending to fabrication process (pre-production check). Their engineer contact us very soon if their are any problem or doubt.

PCBWay also offer a low cost PCB fabrication of the size 10cmx10cm. We can order it between 5 and 10 units for only 5USD. They are standard double sided PCB with solder mask, silkscreen, circuit testing etc.

DIY PIC18F4550 Prototype Board


For a large scale demand we can order their PCB assembly service at reasonable price for any projects.

DIY PIC18F4550 Prototype Board

Click here to download its source file.





Labels