by Jamie Starling | Dec 1, 2021 | The Art of Technology
Using the ADC module in the PIC10F322 – we are going to use a photoresistor (see previous post on Using A Photoresistor) and a Potentiometer (another post here about it) – that will turn on and off a LED based on the amount of light. The trigger point is adjustable...
by Jamie Starling | Dec 1, 2021 | The Art of Technology
We are going to take what we have done with the ADC and expand it some more and add in a button and the interrupt base timer code from a previous post. The setup… RA0 – LEDRA1 – PotentiometerRA2 – Push Button (tied to ground) (weakpull-up is enabled) High level… Press...
by Jamie Starling | Dec 1, 2021 | The Art of Technology
In my other post – PIC10F322 XC8 Analog-to-Digital Converter (ADC) Getting Started. I went over the basics of getting up and going with the ADC on the PIC10F322. The code read the value from a potentiometer and if the value was over a certain range – turn on the LED....
by Jamie Starling | Dec 1, 2021 | The Art of Technology
The PIC10F322 Analog-to-Digital Converter has three selectable external analog channels. This allows you to convert an analog signal (voltage) to an 8bit value (0 – 255) that you can use – to do whatever you dream up. Here is the process that enables the ADC on...
by Jamie Starling | Nov 29, 2021 | The Art of Technology
In the previous post I wrote about using the PIC10F322 Interrupt. In this post is the the complete code that will use timer0, to replace the __delay_ms() macro. Why would we want to replace the __delay_ms() macro? The macro has some limitations, great if you want to...
by Jamie Starling | Nov 29, 2021 | The Art of Technology
Here is a quick overview of how to get interrupts going in XC8. You will need to define your interrupt function or handler in your code. void __interrupt () isr_routine (void) { } The name isr_routine can be anything you want, however __interrupt () is very important...