Matt Baker | 1 Apr 2009 23:42
Picon

PIC examples

Hi
I am having trouble with my 16F690. I used SDCC on Ubuntu 8.10 to create the hex files then using a PicKit 2 on XP to program the PIC.

I couldn't find help on the __config word or any language reference. I have looked in the Wiki but I have not found anything.

I cannot install SDCC on the XP machine so I am stuck with assembler on that laptop.

Any suggestion about converting assembler config into C __config words would be greatfully received. Or where do I find the language reference ?

TIA

Matt Baker

--
My opinions may have changed, but not the fact that I am right.

-- Ashleigh Brilliant

------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Raphael Neider | 2 Apr 2009 01:49
Picon

Re: PIC examples

> I couldn't find help on the __config word or any language reference. I  
> have looked in the Wiki but I have not found anything.

You have to use something like (untested)

static __code unsigned short __at(0x2007) _conf =
	_WDT_OFF & _BOR_OFF & _INTOSC;

assuming that the config word is mapped at 0x2007 (-> datasheet), you
want to turn off the watchdog and brown-out-reset, and use the internal
oscillator. The symbolic constants are all defined in pic16f690, around
line 400.

> Any suggestion about converting assembler config into C __config words  
> would be greatfully received. Or where do I find the language reference?

If you have the config word value (in 0x<hex>, <decimal>, or 0<octal>),
you can simply use

static __code unsigned short __at(0x2007) _conf = <value>;

If you only have the symbolic values, try to match them to the symbols
 from sdcc's 16f690.h device header and combine them all via bitwise AND.

Hope that gets you started,
Raphael

------------------------------------------------------------------------------
Matt Baker | 2 Apr 2009 22:52
Picon

Re: PIC examples

Xiaofan

Thanks I'm now looking into this.

Currently I can't do much I must RTFM :+)

Cheers

Matt B

--
My opinions may have changed, but not the fact that I am right.

-- Ashleigh Brilliant
------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Xiaofan Chen | 2 Apr 2009 00:15
Picon

Re: PIC examples

On Thu, Apr 2, 2009 at 5:42 AM, Matt Baker <chewiebaker@...> wrote:
> I am having trouble with my 16F690. I used SDCC on Ubuntu 8.10 to create the
> hex files then using a PicKit 2 on XP to program the PIC.

You do not need to use PICkit 2 under XP to program the PIC.
You can use pk2cmd natively under Linux (as well as Mac OS X).
http://www.microchip.com/pickit2

Regards,
Xiaofan

------------------------------------------------------------------------------

Gmane