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.

16F88 (and others) Reset itself...

Status
Not open for further replies.

pittuck

New Member
Hi,

I am working on a project which is going through lots of revisions and upgrades as i work on protocols etc. from my pc.

Now i am having a problem with getting up every 10 to 15 mins while deloping to reset the pic to allow the bootloader to work.

I was wondering if it would be possible to use a transistor to reset the pic.

My idea is to have a NPN transistor (i have a 2N2222 to hand) and put the base to a pin on the pic, the emmitter to 0V and the collector to MCLR and then put the base high.

Thing is i am using a switch too... See the img, i am not good with proteus, but eagle and vutrax have not been installed yet...

Also i have a pic if my setup if u want to see:

**broken link removed**

regards.

Martyn
 

Attachments

  • circuit_815.gif
    circuit_815.gif
    3.6 KB · Views: 794
Good job

Hi,

I am working on a project which is going through lots of revisions and upgrades as i work on protocols etc. from my pc.

Now i am having a problem with getting up every 10 to 15 mins while deloping to reset the pic to allow the bootloader to work.

I was wondering if it would be possible to use a transistor to reset the pic.

My idea is to have a NPN transistor (i have a 2N2222 to hand) and put the base to a pin on the pic, the emmitter to 0V and the collector to MCLR and then put the base high.

Thing is i am using a switch too... See the img, i am not good with proteus, but eagle and vutrax have not been installed yet...

Also i have a pic if my setup if u want to see:

**broken link removed**

regards.


The circuit is perfect and it should work perfectly....and u r using 3.1v for vcc but i usualy use standard 5v vcc ..and i also checked the circuit and it works perfectly...pic will reset when base of the transistor is high (2N2222 is high speed switching transistor) and the transistor u used is best for this project.

if u connect an 22k ohms resistor between base emitter...or put an ceramic capacito about 103pf then there wont be any false switching.
 
ok thanks, i wanted to check before i did anything.

The 3.1V is cause i am using 3-3.3V wireless stuff and it is easier to use the pic at 3V and than to interface all the i/o to the wireless devices using 5V - 3V.

3.1V becuase i am using a veriable regulator and thats the voltage i got. It works lol.

Ok trying it now
 
Well its working.

My main target at the moment it to make a app which can datalog remotely.

I am working on a micromouse and want to be able to bootload remotely and debug info back to my laptop while running.

So i am writing a controller for the wireless modules i have. They work on 2.4Ghz, u clock in the data, then tell it to send and it does it in a small amount of time, applys crc 16bit encryption and handles addressing etc.

They are bi-directional, but only work as a i or o at any time.

My current task is datalogging the time for 28bytes of data to be sent, and the success rate. (about 55% i think).

So now i can just type a character when the pic is in command mode (ie waiting for the next command) and tell it to boot, then i can load a new program onto it from way over here ;) lol -> ME LAZY

Eventually i will have 2 plugin mondules which can accept serial or i2c commands to send / recieve data. Cool ;)

Anyhow, still strangling vb.net to work properly, lol
 
hello

Well its working.

My main target at the moment it to make a app which can datalog remotely.

I am working on a micromouse and want to be able to bootload remotely and debug info back to my laptop while running.

So i am writing a controller for the wireless modules i have. They work on 2.4Ghz, u clock in the data, then tell it to send and it does it in a small amount of time, applys crc 16bit encryption and handles addressing etc.

They are bi-directional, but only work as a i or o at any time.

My current task is datalogging the time for 28bytes of data to be sent, and the success rate. (about 55% i think).

So now i can just type a character when the pic is in command mode (ie waiting for the next command) and tell it to boot, then i can load a new program onto it from way over here Wink lol -> ME LAZY

Eventually i will have 2 plugin mondules which can accept serial or i2c commands to send / recieve data. Cool Wink

Anyhow, still strangling vb.net to work properly, lol

oh can i have a look into your circuit or can i get some pictures of it ,cause its quit enterresting..i also like wirless communication but have not tried..and i need a look to your stuffs..the wirles modules ...still i dont know (your loging data from) once me and my friends made some pressure sensor thing which logs data in to an EEPROM and we use to see the sae level rise and stuff heheh..and it works...and every week we connect a laptop to the circuit and takes the logs...

but your project is from wirless so i would like to have it heehee.

thanks
 
I use these wireless units:

**broken link removed**

Quite cheap, but if in the uk buy the insured postage!!!

at the moment i am just using the code supplied from here just tweaked to allow some comms.

I am using a 16F88 to control 2 units, this way i can do timing measurements etc.

Pretty simple really.
 
You do need a resistor between the transistor's base and the pic's output pin, 4K7 or something, to limit base current,...

or, even better, you don't need the transistor at all. Just connect the output pin straight to MCLR and make it a LOW output to reset (keep the pullup resistor, off course)
 
ok thanks for that, i will put a resistor in later ;)

My basic aim is this:

Have 2 pcbs with the wireless devices, a pic and voltage converters & regulators to enable me to 'cold plug' it into different projects.

Buying new wireless modules for every project which could use them is stupid really, so i plan to make the controller pic work on Serial or i2c communications.

I plan to implement my own wireless network protocol to allow data exchange. And probably use manchester encoding rather than CRC.

By the end if it i will be able to put one byte into one module and get it out the other side without needing to write any code for it. (just move a control byte and the data byte into the TX buffer of the PIC, and if the control byte was to receive data then wait for data in the RX buffer)

Not 100% sure yet how etc. But i might use a dataline to indicate if there is received data.

I will allow a 50 byte buffer, or maybe even use some i2c EEPROM and have 256bytes. Either way i still have to get around the problem that i2c is 5V and i am running 3.1V (or 3.3V). I got some maxim chips, but they are samples, more comming i hope...
 
Exo

as exo said
You do need a resistor between the transistor's base and the pic's output pin, 4K7 or something, to limit base current,...

or, even better, you don't need the transistor at all. Just connect the output pin straight to MCLR and make it a LOW output to reset (keep the pullup resistor, off course)

i forgot to tell u that u have to put an resistor in between base and PIC pin...to limit the current..

i dont think its a better idea to connect the output directly to MRCL.cause when u press the switch the voltage will flow in to the output pin of the PIC and some times somthing could happens..so transistor or an optoisolater will be better..try these
 
Re: Exo

techknow said:
i dont think its a better idea to connect the output directly to MRCL.cause when u press the switch the voltage will flow in to the output pin of the PIC and some times somthing could happens..so transistor or an optoisolater will be better..try these

I don't see how anything could go wrong, the pin connected to MCLR should be configured as an input!. It's only when you want to trigger a reset you make it a low output, in wich case still nothing can go wrong, because your switch is connected to the same ground.

if you make it a High output then something can go wrong, but you just should make sure you don't do this. Ppl use open-collector busses with pics all the time (I²C for example) and that has the same requirement.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top