top of page
Search

PIC 16LF15313 With Flowcode.

First - a confession. I've never used a PIC microprocessor with Flowcode. So when the opportunity arose to try - I was starting from scratch.


The processor in question is the PIC 16LF15313 - an 8 pin powerhouse with 3.5kB memory, 256 bytes of RAM, 32MHz clock and some interesting 'extras' such as the NCO (numerically controlled oscillator), CWG (complementary waveform generator) etc (see PIC16F15313 - 8-bit Microcontrollers (microchip.com) for all the specs)


Now I've programmed little MCUs (like the ATTiny 13 and 85) so I'm used to working in a 'small' space. I'm also used to the lack of USB, bootloaders and other 'niceties' that come with a board such as Curiosity or Arduino.


So the first challenge is to get the processor up and running and programmable. If we can't do this anything else is academic.


The circuit - doesn't get any simpler. Plug the chip into a breadboard and apply a power supply (the 'L' version needs a maximum of 3.6V - I used 3.3V from a bench power supply)


Next I needed to connect a programmer - in this case a Pickit 3 (or a clone) - however a Pickit 2 or 4 would also be suitable.


The wiring is


PickKit MCU

Pin 1 Pin 4 (MCLR)

Pin 2 Pin 1 (Vdd)

Pin 3 Pin 8 (Gnd)

Pin 4 Pin 7 (ICSPDat)

Pin 5 Pin 6 (ICSPClk)


Microchip recommend a capacitor across Vdd and Gnd (Vss) and also pulling MCLR (Pin 4) high in use - however for a first test I did neither of these things and the Pickit controls MCLR - to allow the chip to be reprogrammed)


Also connect an LED between an (unused) pin and Gnd via a resistor (220ohm) - or as I did connect an oscilloscope (I used pin A4)


In Flowcode - create a new project and select the appropriate chip. If using Flowcode 9 it is easier to search (right click on the MCU list and select search)


Once the program is created - save it with an appropriate name.


Then select Build - compiler options and select Pickit 3 (or as appropriate) and tick the make default checkbox.



Then create a simple 'blink' program and 'compile to target'



After a few moments the Pickit flashes it's LEDs and then the PIC is programmed.


Success!

51 views0 comments

Recent Posts

See All
bottom of page