PIC users group?

Electronics Computer Programming Q&A
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba »

eeprom refresh is on the order of weeks or months. I suppose daily would be ok.

I guess I see the indirection mechanism as a hack. I'd much prefer indirect modes in the instructions.
bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Post by bodgy »



What is the FED C and does the simulator allow triggering interrups
and switch closures and stuff like that?
FED C comes in two flavours, one is a RAD environment (Wiz-C) in which you place buttons, comms modules etc on to a representation of a PIC and designate the direction of the pins. It then produces skeleton code and you fill in the blanks - surprisingly I find RAD environments difficult to use - so I use the non RAD version, where I write everything.

Built into the IDE is a full simulator - watchdog, buttons, LCD's, I2C, SPI etc.

Part of the simulation is a wave generator that allows you to generate waveforms and triggering on pins.

The biggest drawback with FED C is that the code is not compact due to a software stack that is used - one reason why I also use XCSB as the code bloat is very very minimal, unfortunately the simulator for that is part of another package which costs big money.

I have an recent old copy of FED C on CD - although you can download the unlockable demo from their website - it is locked to the 16F877 and in RAD mode, once unlocked it is the full version and can be de-radded.

If you want PM me your email address and I can send you a screen capture of what it looks like and the simulator options.

Philba: I don't find indirect addressing all that difficult in assembler for the Pic's I have more of a problem with 805x types especially Renesas with the extra registers for redirection - but I suppose it is like most things, the first way of learning tends to be the one that sticks.

As far as the IRP bit is concerned in the 16 series, many programmers write code and then wait for MPLAB to tell them there are errors and then go and put the IRP instructions in. There is however some easy coding that can get around that, and with experience the extra coding that isn't needed can be taken out. One of the benefits of using the linker is that when set up properly it will do this for you.

Colin
On a clear disk you can seek forever.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Hi again Colin,

Thanks for the screen shots.
I think i will be staying away from this for now though, as i am
trying to minimize costs at least until i get a feel for where this
is going, and im not sure if i can use that one PIC or not yet.

I been working on delay generation, which turns out to be
rather complicated but interesting. Im getting delays out to
about 26 years using only six general purpose registers.
Lower delays using less registers...not bad.

My first project will be a timer that comes on every 11.5 hours
and stays on for 0.5 hours, and be externally set with a resistor
divider (or pot) to vary the on time from 5 minutes to about
2 hours in increments of 5 minutes, and change the off time
to keep the period at 12 hours constant.
This turns out to be a chore but it's interesting.

This PIC makes a good chip for decent accuracy timers for delays
of VERY long duration! Very difficult if not impossible to do it
with a 555 timer, although now that i think about it i never
investigated the max delay you can get from a 555 timer ic.
Perhaps use a cap discharge buffer for very large caps?
Accuracy would bite however.
Any guesses out there?
LEDs vs Bulbs, LEDs are winning.
bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Post by bodgy »

I think with a standard 555 the max cap recommended was 10uF or something - there is/was a ZE or ZNE part that allowed long timings - might still have circuit using one.

I like timers and as I'm also a fan of i-Buttons, a trip over to Maxims website will show you some timer chips that'll do just what you want.

That'd make the uC easier to program as well - as the timing doesn't need to be worried about.

An interesting timing algorithm is the one I used in my Water Meter project - you'll note this also has 15 minute increments - easily changed to 5 mins - and can be converted back into assembler quite easily.

You'll also see a couple of timers on my website - with code if they are of any help getting you started.

Colin

ZNE104 keeps ringing a bell.
On a clear disk you can seek forever.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Hi again,

Maybe i should take a look at the Max part, but now im sort of
set on using the PIC so i can start to get used to using them :smile:
and get something useable as the outcome.

Oooh, i like your water controller !!
Also, the temp/humidity controller. What do those sensors cost
approximately in USD?

Geeze, lots of registers to set up before the program can run :smile:
I guess that's a good way to do it though.
LEDs vs Bulbs, LEDs are winning.
bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Post by bodgy »

MrAl wrote:Also, the temp/humidity controller. What do those sensors cost
approximately in USD?
The Sensirion cost about $29.00 US. Available from Parallax, NewarkInOne, Futurlec, FarnellInOne, Mouser.

The flow meter for the water controller is horrendously expensive and only available (AFAIK) from RS Components.

I'm toying with the idea of remaking the sensor by either using a heating coil and measuring heat loss or by some means of sensing pressure - which would be much cheaper and be 'makable' at home.

As far as register setting up is concerned, yes and no. Most of the Pic SFR registers default to a known setting, however there are some bits which have a toss of the coin, and all parts that have analogue input capabilities always start up in anologue mode - so have to be explicitly switched to digital for those pins.

The setting of the registers manually just ensures that you're not leaving something to chance.

Colin
On a clear disk you can seek forever.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Hi again,

Oh yeah, that sounds very interesting. I'd be interested in trying
one if you feel like working out some details.

Yes, i prefer setting up as many registers as could be randomly
set.

Recently, i got a new chip: 16F684, which has two comparators
and a 10 bit PWM circuit in addition to AD and other stuff. I might
end up experimenting with this chip first, although it looks like more
registers to set up :smile:
Good news is it doesnt use the program memory bank switching
(for calls and gotos) as there is only 2k of memory.
Pricing doesnt seem to be too bad either.
LEDs vs Bulbs, LEDs are winning.
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba »

the other issue with SFRs is that there can be different init values on cold start vs mclr reset vs brownout vs watchdog. It's not a complete mess but you need to read the datasheet carefully. or just not make any assumptions as the to initial value (a much better approach, imho).

On the PIC's indirect approach - I don't think it's hard. In fact, I think it's awfully simplistic. I'd like to be able to use any memory location as an indirect pointer, with a base value. and yeah, I learned assembler on the PDP-11.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Hello again,

Yeah i think i know what you mean. I read the data sheets over and
took some notes, then programmed my first chip about two hours ago.
I must have gotten lucky because it worked on the first try.
Lots of register bits to think about haha, but it's worth it in the end.

While im here i guess i can ask another question...

Did anyone here ever use the Delta Sigma method for measuring
an external voltage (similar to AD conversion only much more
accurate)?
I'd like to try to get at least 12 bit accuracy but it doesnt have to be
fast.
They have a few notes in a small book from Microchip but they
are not clear on how this method works. I'd have to sit down and
calculate everything out unless someone here knows the relationships
already .... and TIA.

.
LEDs vs Bulbs, LEDs are winning.
bert612
Posts: 2
Joined: Wed Nov 01, 2006 1:59 am
Contact:

Re: PIC users group?

Post by bert612 »

[quote="MrAl"]Hi there,

Anyone know of a PIC uC users group ? The one i found on
the web seems a bit outdated...last post i think was in 2005 or
something.

.[/quote]

If you care to program in JAL they have a rather active user group:

http://x.webring.com/hub?ring=jal

(JAL is a high level free language).

Bert
bert612
Posts: 2
Joined: Wed Nov 01, 2006 1:59 am
Contact:

JAL usergroup

Post by bert612 »

Sorry, I meant to post this link:

http://tech.groups.yahoo.com/group/jallist/

Bert
bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Post by bodgy »

Did anyone here ever use the Delta Sigma method for measuring
an external voltage (similar to AD conversion only much more
accurate)?
Microchip do have an application note on this and I'll have to look up its obscure number on the CD - found it AN700a is the application note. If you can't find it I can send it to you, it's a 170Kb in size.

There is also an excellent book Analog Interfacing to Embedded uP by Stuart Ball which has a small treatise on Sigma Delta techniques ISBN 0750677236.


Colin
On a clear disk you can seek forever.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Thanks Bert for the link and thanks Bodgy for the info.
I'll take a look for that app note.
I dont need theory on D/S converters in general, but on the technique
Microchip seems to be saying that works -- which right now i dont have
any info on.


LATER
Ok, found app note 700 and it seem to be just what i was looking for.
Looks fairly simple to implement this type of converter wow.
Thanks for the info Bodgy.
LEDs vs Bulbs, LEDs are winning.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Hi again,

philba:
I see what you mean about the indirect register mechanism for these
chips. It sometimes wont be convenient to have to load another
register first before you can access the one you want.

Another slight problem i ran into with the MpLab that Microchip
puts out...
When i go to try to compile one of the demo programs that is written
in 'C' it gives an error saying:
"PCM is not installed on this computer".
When i do a search for anything with "PCM" in it nothing turns up,
which tells me PCM really isnt installed.
Apparently this is some sort of third party software?
Anyone know if it is available for download somewhere?

I was more or less planning on using assembler (which works ok
with MpLab right now) but i thought it would have been nice to
compile some of the demo programs that are written in C too.

Thanks..........
LEDs vs Bulbs, LEDs are winning.
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba »

when you created the project, did you select the tool suite for the compiler you have? You can select the active toolsuite in project/toolsuite
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests