Searching \ for '[PIC] Noob questions (PIC16F684)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'Noob questions (PIC16F684)'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Noob questions (PIC16F684)'
2006\02\02@154207 by Metis Adrastea

picon face
Hi pals!

I've spent the last days trying to write my first pic program in ASM.
It's pretty simple, but it involves an A2D conversion and some other
tricks and I've developed several doubts I'm afraid I can't solve by
myself. So my questions are the following:

1.- If you set the ADCON0,GO bit, it really clears by itself as stated
in the datasheet? I've tried my program in the "pic simulator IDE"
(http://www.oshonsoft.com/pic.html) and it doesn't clear by itself.

2.- If you put a 8 bit value into a 6 bit register (PORTC), does the
PIC take the 6 lsb and move them into the register or something?

3.- That nasty 302 messages are just annoying or am I doing anything
bad? What's up with that bank mess in the compiler?

Please do not be too cruel with me, I'm just starting :)

Regards

Metis Adrastea
--
He comentado ya que tengo un blog? O:-)
http://metisadrastea.blogspot.com/

2006\02\02@225324 by Peter van Hoof

face picon face

Metis Adrastea spam_OUTmetisadrasteaTakeThisOuTspamgmail.com wrote

>Hi pals!

>I've spent the last days trying to write my first pic program in ASM.
>It's pretty simple, but it involves an A2D conversion and some other
>tricks and I've developed several doubts I'm afraid I can't solve by
>myself. So my questions are the following:


>1.- If you set the ADCON0,GO bit, it really clears by itself as stated
>in the datasheet? I've tried my program in the "pic simulator IDE"
>(http://www.oshonsoft.com/pic.html) and it doesn't clear by itself.

Yes, and I have tested it in the simulator, perhaps you have a problem
somewhere else in your code.
Did you turn the adc module on? (ADCON0,ADON)?

I think in the datasheet page 69 it incorrectly states the following at step 4

4. Start conversion:
• Set GO/DONE bit (ADCON0<0>)
I think this should be ADCON0<1> bit 0 is the ADON bit


>2.- If you put a 8 bit value into a 6 bit register (PORTC), does the
>PIC take the 6 lsb and move them into the register or something?

In the PORTC REGISTER (ADDRESS: 07h) description it states
bit 7-6: Unimplemented: Read as ‘0’
in general this means that when writing to it the value gets lost

>3.- That nasty 302 messages are just annoying or am I doing anything
>bad? What's up with that bank mess in the compiler?

Message 302 is a warning from the assembler that the register you are
attempting to use is in a different bank than bank0 it is the responsibility
of the programmer to select the correct bank before accessing registers
This is also important if you access bank0 registers (after all you could
be in another bank)

See the description of the banksel compiler directive in the assembler manual
and STATUS.RP0 description in the datasheet.

When you get into longer programs you will see a similar problem when
jumping to different parts of program memory.

>Please do not be too cruel with me, I'm just starting :)
I hope you have as much fun with pic's as I do.
Talk to you later

Peter van Hoof

>Regards

>Metis Adrastea

2006\02\03@055111 by olin piclist

face picon face
Metis Adrastea wrote:
> 1.- If you set the ADCON0,GO bit, it really clears by itself as stated
> in the datasheet? I've tried my program in the "pic simulator IDE"
> (http://www.oshonsoft.com/pic.html) and it doesn't clear by itself.
>
> 2.- If you put a 8 bit value into a 6 bit register (PORTC), does the
> PIC take the 6 lsb and move them into the register or something?
>
> 3.- That nasty 302 messages are just annoying or am I doing anything
> bad? What's up with that bank mess in the compiler?

These are all good beginner questions, and I think I can answer them.
However I don't want to do that here while my posts are being subjected to
censorship.  Go over to the Microchip forums (http://forum.microchip.com)
post your questions there, and I'll try to answer them (if others don't beat
me to it).  Make sure to pick the right forum for each.  For example, the
"A/D Converter" forum would be good for the first one, "Digital I/O ports"
for the second, and "MPASM, MPLIB, MPLINK" for the third.


******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014.  #1 PIC
consultant in 2004 program year.  http://www.embedinc.com/products

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...