Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Micromite setpin at power up?
Author | Message | ||||
sagt3k Guru Joined: 01/02/2015 Location: ItalyPosts: 313 |
Hi Geoff It is possible to think to create a function that save the settings and configs of the pins? So that the next power up I've already the pins configured. Thanks |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9078 |
I'm curious - why would you need to? As a first few lines of code, right at the top of your code, define your pins - job done. Time to configure the I/O pins would only be a few mS if that, depending on how many you are talking about here. ...I may well be missing something in what you are trying to do... Smoke makes things work. When the smoke gets out, it stops! |
||||
sagt3k Guru Joined: 01/02/2015 Location: ItalyPosts: 313 |
HI Grogster Thanks, I know... I can set all pins with a few of instructions at top of my code. But, when I mount my Pic in my application, where there are others devices, pmos, transistors, circuit for battery charger and so on, I think that ms is a huge time. This is my opinion... In truth, I have not measured how time micromite take to cfg all pins, but I think that a internal procedure wrote in C/assembler is always faster that Basic. Thanks |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3167 |
If your peripherals are so sensitive I believe that the best solution would be to use pullups or pulldowns on them. Then they will be in the correct state as power is applied. Also, the problem with this is that there are hundreds of special features like this that could be added... where do you stop? BTW the startup delay is about 250mS although I have not measured it accurately. Geoff Graham - http://geoffg.net |
||||
sagt3k Guru Joined: 01/02/2015 Location: ItalyPosts: 313 |
Ok Geoff. I will try to set-up my circuit as you have suggested. Thanks |
||||
srnet Senior Member Joined: 08/08/2014 Location: United KingdomPosts: 164 |
Agree with Geoff on this one. You should design your circuit so that it starts in a safe state, even if the Micro fails to start for some reason. The MM pins will be as inputs at reset\powerup so if they need to be at a particular logic state to be safe, then pull up\down resistors as appropriate are essential. $50SAT is Silent but probably still working. For information on LoRa visit http://www.loratracker.uk/ |
||||
Print this page |