Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Mplab

Status
Not open for further replies.
I have MPLAB v8.53 and I have recently also loaded PICkit2 v2.61. They both appear to work fine although I have not actually blown a PIC yet. My question is this. In the MPLAB toolbar under Programs the PICkit 2 is listed but it is greyed out and is not accessible from within MPLAB. Is there some way of loading PICkitt so that it is accessible from within MAPLAB?

Eddie Price

just noticed that I had written PICstart instead of PICkit
 
Last edited:
Thanks SneaKSz. Yes I see now. Particular programmers are activated for particular microprocessors. I was planning to use a PIC16F84 and the PICkit 2 is not selected for this chip. When I chose a PIC16F819 it was selected. Does that mean I can't program a PIC16F84 with a PICkit2!!!!!!! I will have to study the instructions a bit more carefully.

Thanks
Eddie
 
I have a PICKit 2 as well , I downloaded the " PICkit 2 v2.61" , MPlab generates a hex file , you import the hex into PICkit 2 and program the microcontroller.

I think you"re able to program your PIC16F819 with PICkit program , your µC is listed.

Greetings
 
The 16F84 is not supported by the PICKit2, the 16F84A is.
The 84 series is ancient, there are cheaper and better choices like the 16F628A or 16F88
 
Thanks Blueroom. I am still at the learning stage and will look at some of the other PICs in due course. My program will involve polling a number of switches, say 4. Presumably I need to write in a debounce routine for each switch. I will then be generating a code depending on which switch has been pressed and then transmit to a Rx. I think I read somewhere that it is a good idea to transmit some junk to get the Rx up and running before the code is received. Any comments?

Eddie Price
 
Rx ? so you want to transmit something to your PC?

First set up all the ports and functions like you would like to use ( eg USART) and then start your code for polling the switches

greets
 
Hi SneaKZe.

No I am making a wireless based controller for a garden railway. The switches will be used for speed control and direction. If I have more than one engine then I will need to include an address code. I am fairly happy about setting which port is input and which is going to be an output, and for polling the switches, but I am not so sure about debounce. Presumably I have to do this for each switch? and how much of a delay is required to take account of bounce? I will probably use a 4MHz oscillator simply because I have some 4MHz ceramic resonators.

Eddie
 
There will be bounce on the switches , hmm , you can use interrupts. If a switch is switched the program will stop from working ( execute his last instruction) and go to an interrupt vector , here you can wait the debounce time and check witch switch was pressed , after that you can go to the routine that handles that switch.

For the debounce time you can use a self made delay or use a timer. I think after 500 ms you'll get the correct data , the final state.

I dont know how you would check the state of the switches if you wouldnt use interrupts hmm ...

btfss portX,pinX ?
goto testAnotherPin
goto pressed

If there is bounce on the you won't get the correct data.

You can use use the "intterrupt on change PORT A/B" function , this will notice if a state of an input has changed. I think these are 4 inputs and if 1 changes a flag will be set.

Well I'm not the best person to ask, I'm not that skilled in micro controllers , It's maybe better to open a new thread and ask that question again?

Bye
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top