10f2xx

For stand-alone microprocessors

10f2xx

Postby Starfire » Wed Sep 22, 2010 12:03 pm

Doug - I'm trying to get the timer to run on a 10f200 but failing - used to 16f84 and new to 10f2xx family - do you have any experience of these? - I work only in assembly in MPLAB
Starfire
 
Posts: 143
Joined: Thu Aug 05, 2010 4:26 pm
Location: North Ireland

Re: 10f2xx

Postby Doug Coulter » Wed Sep 22, 2010 1:41 pm

Nope, I've never used them myself. I do do pic assembly in general though, and I read the books pretty good -- I've figured out how to decode their dox fairly well. What is it you're trying to do? Count from internal source, external source, make an interrupt? Usually when starting with a new family, about the first thing we do is some sort of dirt-simple hello world, which might just be putting an LED on a pin and writing a spin loop to toggle it at some human (or scope) see-able speed to make sure we have *anything at all* working as expected and our code is getting reached at all. Most of the troubles seem to be right at that point, and it's all downhill from there. We had some interesting fun with the 18f for example, as changing some of the config fuses doesn't change anything until the next power cycle -- reset alone doesn't get them re-read....little junk like that can make you crazy -- and after a lot of digging, is barely mentioned in the book, in an odd place.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: 10f2xx

Postby Starfire » Thu Sep 23, 2010 7:29 am

10f200 doesnt have an interupt and you've got to load the ' w ' as an intermediate before testing for role-over. just trying to bounce off some one - thanks
Starfire
 
Posts: 143
Joined: Thu Aug 05, 2010 4:26 pm
Location: North Ireland

Re: 10f2xx

Postby Doug Coulter » Thu Sep 23, 2010 11:02 am

Ah, I went and got the data sheet on this. It's a lot like their much earlier (12/14) series stuff, which I did use at one time, just that this has flash and fewer pins, nice. They mean it when they show how to set up the prescaler so you don't get into a WD timeout loop issue -- I've run afoul of that one...and you obviously have to be checking that counter close to make sure it doesn't roll over more than once between checks!

I try everything I can to make it easier to get going on these -- a led on a pin is a good idea, you can toggle it in software and see it, or look with a scope to see if your software flow is as expected.

So, what do you plan to do with it?
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: 10f2xx

Postby Starfire » Thu Sep 23, 2010 2:48 pm

The led is just to confirm - a test indicator. The thing is, a SOT-23 or DFN package, is the smallest. :)
Starfire
 
Posts: 143
Joined: Thu Aug 05, 2010 4:26 pm
Location: North Ireland

Re: 10f2xx

Postby Doug Coulter » Thu Sep 23, 2010 3:12 pm

Yeah, the dinky package is cool indeed -- kinda hides the fact that you even have a uP in there. I find I more or less have to make a little PCB to handle those, though. And the price is right, these things even get used in lamp dimmers they are so cheap, for timing the triac firing. That makes the triac cheaper too, as it doesn't have to have a diac in it.

Last time I used one like this, we used one (with more pins) to do that app note Microchip has on a homebrew a/d, dual slope like a DVM. We used that to make a product that keeps track of charge going into and out of lead acid batteries for solar systems. For that, you need a couple good caps and a cmos switch, too and we used a comparator instead of one of the schmitt inputs to get to 14 bits or so resolution. Nowadays, you'd just use a cheap I2C a/d for that, which would cost less than the polypropylene caps we had to use. Those are in sot 23 packages now too, and we have some 24 bit and they also have a temperature sensor for use with thermocouples as the "cold junction" compensation.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: 10f2xx

Postby Starfire » Sat Sep 25, 2010 4:32 pm

Ahh! the ' clrf GPIO ' doesn't work - well it does but it doesn't clear the O/P pins just the latches - stupid
Starfire
 
Posts: 143
Joined: Thu Aug 05, 2010 4:26 pm
Location: North Ireland

Re: 10f2xx

Postby Doug Coulter » Sat Sep 25, 2010 5:31 pm

Yes, the TRIS has to set the pin as an output for it to be an output....
In PICS with so little memory, people have even been known to use the latches to store a bit....and other tricks that have a tendency to make trouble if not watched carefully in all other programming.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA


Return to Embedded software

Who is online

Users browsing this forum: No registered users and 3 guests

cron