My Experience with PIC

About 15 years ago a friend gave be a pile of PIC datasheets. I looked into them, read a few bits and decided PICs are not for me. Not much later another friend bought an AVR development kit and gave it to me to find out how it works. It wasn’t hard to get everything up and running. So I used AVRs since then, and if I need something bigger I take an STM32. But now I have a project which uses PIC18 and I was forced to bite the bullet. So here is my experience with the PIC hardware and software.

Continue reading

UDEV rule for USBASP

Again I got permission denied to access USBASP using avrdude. To fix this an UDEV rule has to be created.

A long time ago I created the file /etc/udev/rules.d/99-USB-AVR-PRG.rules with the following content:
# see:
# udevadm info -a -p /sys/bus/usb/devices/3-1
# After a change restart udev:
# systemctl restart udev.service

# borked rule
# Atmel AVR ISP mkII
#SUBSYSTEM=="usb", SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2104", GROUP="users", MODE="0660"

# usbprog bootloader
#ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c62", GROUP="users", MODE="0660"

# USBasp programmer
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="users", MODE="0666"

# USBtiny programmer
#ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c9f", GROUP="users", MODE="0660"

Most of the content is shamelessly copied and then commented out, then for me the only interesting line is the one for USBASP.

After copying the file I restarted UDEV with the following command:
systemctl restart udev.service

Now after plugging in USBASP the device should get the appropriate permissions.

Multimeter Upgrade

What is worse than a battery powered multimeter?

A battery powered multimeter with an empty battery.

That’s why I have to upgrade this multimeter with a power socket, a step-down converter to support a wide input voltage range, and an isolated DC-DC converter to isolate the input voltage from the multimeter circuits.

Continue reading

Fixed Battery Light

Today I fixed my battery light. I changed R15 to 39k, and for R14 I had used 33k since I didn’t have anything between 22k and 33k. The threshold voltage is now at most 7.3V so this rubbish wire can make a voltage drop of over 4V and it will still work. And just for testing I’ve put a 470uF cap instead of the 100nF for C5. I left this one inside, it makes a nice delay for the LDR just in case some stray light hits it. Here is the updated schema (more docs).

Now I’m happy with it. Except maybe I add a sleeping mode where it makes just enough light to see the walls, or adding a wire to the bathroom and putting a PIR sensor and an LED there, or … ;)