Searching \ for '[PIC] MPLAB-question regarding changing register v' 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/languages.htm?key=mplab
Search entire site for: 'MPLAB-question regarding changing register v'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] MPLAB-question regarding changing register v'
2007\03\07@041927 by Rikard Bosnjakovic

picon face
I've written a small assembly-code in MPLAB and simulate it. I open a
watch-window (View->Watch) and add a couple of symbols and SFRs. To
change the values, I simply double-click it and type in a new one.
Works fine, except for PORTA. No matter which value I try to set in
PORTA, it returns to the initial zero. Does this have something to do
with that I've set MCLRE in the config word to zero, or what's the
reason?

Snippets of my initialization code:

__CONFIG _CP_OFF & _WDT_ON & _BODEN_ON & _PWRTE_ON & _ER_OSC_CLKOUT &
_MCLRE_OFF & _LVP_ON

[...]

start
       bsf     STATUS, RP0                      ; select bank1 for
configuration of TRISA/TRISB
       bcf     STATUS, RP1
       movlw   b'00000111'                      ; RA[0:2] inputs (switches)
       movwf   TRISA                            ; RA[3:7] outputs
(number for active LED)

       movlw   b'00000000'                      ; RB[0:7] outputs
(LED-segments)
       movwf   TRISB
       bcf     STATUS, RP0                      ; switch back to bank0

At first I thought it was because bits 0:2 are set to input ports and
that the simulator will block any values coming to it, so I just tried
to change the upper bits in the register. But alas, same problem.


--
- Rikard.

2007\03\07@043330 by Dario Greggio

face picon face
Rikard Bosnjakovic wrote:

> Works fine, except for PORTA. No matter which value I try to set in
> PORTA, it returns to the initial zero. Does this have something to do
> with that I've set MCLRE in the config word to zero, or what's the
> reason?

Hi Rik, maybe you need to configure it as Digital (as opposed to analog,
which is the default.)


--
Ciao, Dario

2007\03\07@051458 by Rikard Bosnjakovic

picon face
On 3/7/07, Dario Greggio <spam_OUTadpm.toTakeThisOuTspaminwind.it> wrote:

> Hi Rik, maybe you need to configure it as Digital (as opposed to analog,
> which is the default.)

Could you hint me of how to do this? I'm not yet very proficient in using MPLAB.

To be on the safe side, I checked the datasheet for the chip in
question and turned off the comparator mode. But something must be
wrong, because these two

       movlw   b'11111000'
       movwf   TRISA

Yields "00111000" in TRISA. RP0 is set and RP1 is cleared before
setting TRISA. Perhaps I should find a more decent beginner book than
"The quintessial PIC microcontroller" that I'm using.


--
- Rikard.

2007\03\07@053549 by Dario Greggio

face picon face
Rikard Bosnjakovic wrote:

> To be on the safe side, I checked the datasheet for the chip in
> question and turned off the comparator mode. But something must be
> wrong, because these two
>
>         movlw   b'11111000'
>         movwf   TRISA
>
> Yields "00111000" in TRISA. RP0 is set and RP1 is cleared before
> setting TRISA. Perhaps I should find a more decent beginner book than
> "The quintessial PIC microcontroller" that I'm using.

:-)

I have this in my 16F628:
       movlw        00000111b                ; comparatori OFF
       movwf        CMCON

       clrf  TRISA                                                        ; TUTTE output (non uso MCLR, ma reset interno)


Just be sure BANKING is correct, maybe you can use BANKSEL macros if
you're just starting out with PICs :)

--
Ciao, Dario

2007\03\07@053618 by Alan B. Pearce

face picon face
>> Hi Rik, maybe you need to configure it as Digital (as opposed to analog,
>> which is the default.)
>
>Could you hint me of how to do this? I'm not yet very proficient in using
>MPLAB.
>
>To be on the safe side, I checked the datasheet for the chip in
>question and turned off the comparator mode.

Well, that should have done it, but you don't say what chip you are using,
or precisely what instructions you used to do this.

>But something must be wrong, because these two
>
>        movlw   b'11111000'
>        movwf   TRISA
>
>Yields "00111000" in TRISA.

How many bits are there in PORT A? That sounds like there are only 6 bits
(RA0 to RA5) and so the top two bits are not used. Again, you don't say what
chip you are using.

2007\03\07@053628 by Artem Zezyulinskiy / SEDATELEC

flavicon
face
Hi Rickard,
I don't know your version of PIC, but to turn the port Analog or Digital
you can use the ADCON1 register (i use 16F777) or ANSEL register on
others Pics.. You must read the section Analog-To-Digital Converter
module to know the register to modify.

{Quote hidden}

Do you have a quartz or other oscillator Connected to PORTA <6,7> ????

Artem

2007\03\07@054631 by Rikard Bosnjakovic

picon face
On 3/7/07, Alan B. Pearce <.....A.B.PearceKILLspamspam@spam@rl.ac.uk> wrote:

> How many bits are there in PORT A? That sounds like there are only 6 bits
> (RA0 to RA5) and so the top two bits are not used. Again, you don't say what
> chip you are using.

Sorry.  I'm using a 16F628A, 16 I/O-ports according to the datasheet


--
- Rikard.

2007\03\07@055827 by Dario Greggio

face picon face
Rikard Bosnjakovic wrote:

> Sorry.  I'm using a 16F628A, 16 I/O-ports according to the datasheet

don't know why, but I did feel it :)

2007\03\07@061813 by Jan-Erik Soderholm

face picon face
Rikard Bosnjakovic wrote:

> I open a watch-window (View->Watch) and add a couple of
> symbols and SFRs. To change the values, I simply double-click
> it and type in a new one.

Why do you change the values directly in the *watch* window ?
I only use watch to *watch* the values.
The values as such are changed in the assembly *code*...

> No matter which value I try to set in
> PORTA, it returns to the initial zero.

Any port-pin with it's analog function enabled always
read as "0". This is documentet in the data sheet and
MPSIM seems to "simulate" this also...

Regards,
Jan-Erik.


2007\03\07@062120 by Rikard Bosnjakovic

picon face
On 3/7/07, Dario Greggio <adpm.tospamKILLspaminwind.it> wrote:
> I have this in my 16F628:
>         movlw   00000111b               ; comparatori OFF
>         movwf   CMCON
>         clrf  TRISA                                                     ; TUTTE output (non uso MCLR, ma reset interno)

When I add a clrf TRISA, its contents gets "cleared" to "00100000"
which is correct, since RA5 can only be input, but when I try to move
11111000 to it, it gets 00111000.

I must have missed something trivial, because I really don't
understand what's going on here.

Help?

--
- Rikard.

2007\03\07@062826 by wouter van ooijen

face picon face
> Sorry.  I'm using a 16F628A, 16 I/O-ports according to the datasheet

Read again. *up to* 16 pins, and IIRC one can only be input.

Wouter

2007\03\07@063320 by Dario Greggio

face picon face
Rikard Bosnjakovic wrote:

> When I add a clrf TRISA, its contents gets "cleared" to "00100000"
> which is correct, since RA5 can only be input, but when I try to move
> 11111000 to it, it gets 00111000.


Really it should not happen. I can only think of a banking issue when
accessing TRISA. But you already checked it.

2007\03\07@063638 by Rikard Bosnjakovic

picon face
On 3/7/07, wouter van ooijen <.....wouterKILLspamspam.....voti.nl> wrote:

> Read again. *up to* 16 pins, and IIRC one can only be input.

Page 3:

  Peripheral Features:
  • 16 I/O pins with individual direction control



--
- Rikard.

2007\03\07@063826 by Alan B. Pearce

face picon face
>Sorry.  I'm using a 16F628A, 16 I/O-ports according to the datasheet

Right. Now look at the datasheet Table 5-1 on page 35. Have you configured
the extra functions on those two port pins off or on?

2007\03\07@064643 by Jan-Erik Soderholm

face picon face
See (and read! :-) ) "Note 3" in the grey box on the page
with the description for PORTA in the datasheet.

Regards,
Jan-Erik.


Rikard Bosnjakovic wrote:

> but when I try to move
> 11111000 to it, it gets 00111000.


2007\03\07@065546 by Rikard Bosnjakovic

picon face
On 3/7/07, Jan-Erik Soderholm <EraseMEjan-erik.soderholmspam_OUTspamTakeThisOuTtelia.com> wrote:
> See (and read! :-) ) "Note 3" in the grey box on the page
> with the description for PORTA in the datasheet.

Ok, now I'm a bit confused as things seem to go way above my basic
level of knowledge right now so I have no clue what to do.

Scenario: I need 5 inputs and 11 outputs. PORTB is set to all outputs,
so I have only PORTA left. 5 inputs and 3 outputs does fit, but I seem
to lack the proper magic to configure the upper bits of PORTA.

Feel free to point me to a place that helps me understand what I'm
supposed to do and why. The datasheet is good as a reference, but
since this is my first playground with a PIC, it tends to get very
complicated very quickly.


--
- Rikard.

2007\03\07@065638 by Jan-Erik Soderholm

face picon face
15 input/output pins.
1 *input-only* pin (RA5/MCLR).

Jan-Erik.



Rikard Bosnjakovic wrote:
{Quote hidden}

2007\03\07@070445 by Rikard Bosnjakovic

picon face
On 3/7/07, Jan-Erik Soderholm <@spam@jan-erik.soderholmKILLspamspamtelia.com> wrote:

> 1 *input-only* pin (RA5/MCLR).

Yes. I have configured RA5 as input-pin and disabled MCLR in the config word.

And the reason I change the values in the watch-window is for
debugging purposes. In a loop, for example, it can be very useful to
change the loop-variables. And for PORTA, a variant of simulating
inputs.


--
- Rikard.

2007\03\07@070641 by Dario Greggio

face picon face
Rikard Bosnjakovic wrote:

> Scenario: I need 5 inputs and 11 outputs. PORTB is set to all outputs,
> so I have only PORTA left. 5 inputs and 3 outputs does fit, but I seem
> to lack the proper magic to configure the upper bits of PORTA.

just a hint: you know that you can do this only using Internal Oscillator

2007\03\07@082355 by michael brown

picon face
Rikard Bosnjakovic wrote:
> I've written a small assembly-code in MPLAB and simulate it. I open a
> watch-window (View->Watch) and add a couple of symbols and SFRs. To
> change the values, I simply double-click it and type in a new one.
> Works fine, except for PORTA. No matter which value I try to set in
> PORTA, it returns to the initial zero. Does this have something to do
> with that I've set MCLRE in the config word to zero, or what's the
> reason?
>
> Snippets of my initialization code:
>
> __CONFIG _CP_OFF & _WDT_ON & _BODEN_ON & _PWRTE_ON & _ER_OSC_CLKOUT &
> _MCLRE_OFF & _LVP_ON

Part of the problem is right here.  You need to use INTOSC to be able to
free up the OSC1 and OSC2 pins.  It is only two speeds (37kHx and 4MHz),
you set the speed using the OSCF bit in the PCON sfr.  So instead of
_ER_OSC_CLKOUT, you want something like "_INTRC_OSC_NOCLKOUT".  If the
assembler doesn't like that, try "_INTOSC_OSC_NOCLKOUT".  Microchip has
a problem with consitency on this stuff.  Be careful with that LVP_ON
stuff and trying to use /MCLR as an input pin, I'd change that too if I
were you.

2007\03\07@084513 by Forrest W Christian

flavicon
face
Rikard Bosnjakovic wrote:

>Feel free to point me to a place that helps me understand what I'm
>supposed to do and why. The datasheet is good as a reference, but
>since this is my first playground with a PIC, it tends to get very
>complicated very quickly.
>  
>
When you use a pin which has multiple functions, like the RA6 and RA7
pins do on your part, you MUST look at the other functions and make sure
you have turned them off.

This datasheet infers this in at least 2 different places in regards to
RA6 and RA7.....

On Page 31, in the grey box, note #3...  "TRISA<6:7> is overriden by
oscillator configuration.  When...overriden, the data reads '0' and
the...bits are ignored"

On Page 96, talking about bit4, 1 and 0 in the configuration registoer
"100=INTOSC oscillation: I/O function on RA6/OSC2/CLKOUT pin, I/O
function on RA7/OSC1/CLKIN", with other bit definitions saying that the
RA pin is used for someting else.

Generally, when I use a pin, I make sure I understand everything the pin
is used for - at least as far as how to disable that function on the
pin.  In this case, those pins are shared with the clock oscillator
circuit, which needs to be switched to a mode where they aren't being
used for the clock oscillator.  

Personally, I would have used a slightly bigger device so I could have
dedicated the RB4/RB6/RB7 pins to the ICD functionality, and avoided the
need to re-use the OSC.  The 16f886 for example is a 28pin device (10
more pins) with a 8mhz adjustable internal clock (double the speed),
8Kwords of flash (4 times the memory), A/D converters, and so on...for
$0.71 more - ($2.57  vs $1.86 Qty 1)

-forrest


2007\03\07@085711 by Rikard Bosnjakovic

picon face
On 3/7/07, michael brown <KILLspamn5qmgKILLspamspamearthlink.net> wrote:

> Part of the problem is right here.  You need to use INTOSC to be able to
> free up the OSC1 and OSC2 pins.  It is only two speeds (37kHx and 4MHz),
> you set the speed using the OSCF bit in the PCON sfr.  So instead of
> _ER_OSC_CLKOUT, you want something like "_INTRC_OSC_NOCLKOUT".  If the
> assembler doesn't like that, try "_INTOSC_OSC_NOCLKOUT".  Microchip has
> a problem with consitency on this stuff.  Be careful with that LVP_ON
> stuff and trying to use /MCLR as an input pin, I'd change that too if I
> were you.

That line is from the template-file from Microchip's MPLAB-tutorial, I
have no idea what the values are so I left them untouched. It seems
it's possible to change them from the menu in case I need it (which I
obviously seem to do).

But again, this is my first glance with PICs so I don't yet know all
this kind of black magic (the datasheet is pretty heavyweight and I
haven't got through it all). It does, however - according to what you
write, look like I've run into a problem since I need a
32.768kHz-crystal.

I guess I'll have to trim down the inputs to three and multiplex them
together using diodes. Ugh.


--
- Rikard.

2007\03\07@094439 by Forrest W Christian

flavicon
face
Rikard Bosnjakovic wrote:

>according to what you
>write, look like I've run into a problem since I need a
>32.768kHz-crystal.
>
Depending on exactly why you need to run this at this clock rate, you
might be able to get away with the on-board 4Mhz clock with a timer.

I'd really consider moving to a different (bigger) part like the 16f886
(28Pin) or 16f887 (40Pin), since you probably will also want to be able
to do ICD at some point, which also requires 3 pins.  The '886 is only
about $0.80/each more.

-forrest

2007\03\07@095017 by michael brown

picon face
Rikard Bosnjakovic wrote:
> On 3/7/07, michael brown <RemoveMEn5qmgTakeThisOuTspamearthlink.net> wrote:
>
>> Part of the problem is right here.  You need to use INTOSC to be
>> able to free up the OSC1 and OSC2 pins.  It is only two speeds
>> (37kHx and 4MHz), you set the speed using the OSCF bit in the PCON
>> sfr.  So instead of _ER_OSC_CLKOUT, you want something like
>> "_INTRC_OSC_NOCLKOUT".  If the assembler doesn't like that, try
>> "_INTOSC_OSC_NOCLKOUT".  Microchip has a problem with consitency on
>> this stuff.  Be careful with that LVP_ON stuff and trying to use
>> /MCLR as an input pin, I'd change that too if I were you.
>
> That line is from the template-file from Microchip's MPLAB-tutorial, I
> have no idea what the values are so I left them untouched. It seems

Read about them, you need to know this stuff.  They're just like option
switches, you turn them on or off.  You'll see that the CLKOUT stuff
passes the Fosc/4 clock out a port pin making it unusable to you.  The
ER thingy is also tying up one of your port pins thinking that you have
an external R/C connected to act as the clock.  You could try this for
your CONFIG word settings:

             __CONFIG    _CP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_OFF &
_LVP_OFF & _INTRC_OSC_NOCLKOUT


> it's possible to change them from the menu in case I need it (which I
> obviously seem to do).

Yes, you do.  Change the LVP option to OFF as well.  It won't make any
difference to the simulator, but it will to you when you start burning
PICs for real.

> But again, this is my first glance with PICs so I don't yet know all
> this kind of black magic (the datasheet is pretty heavyweight and I
> haven't got through it all). It does, however - according to what you
> write, look like I've run into a problem since I need a
> 32.768kHz-crystal.
>
> I guess I'll have to trim down the inputs to three and multiplex them
> together using diodes. Ugh.

Make sure you have this in your program too:
             movlw       0x07                 ;turn of the comparators
             movwf       CMCON

When you get ready to buy some PICs think of the 16F88 instead of the
16F628.  It's the newer model with more features (like ADC, nanowatt
power consumption, INTOSC that runs at 8MHz w/1% accuracy).  And it
costs less too.  It's pretty much backwards compatible with the 16F628,
but does require a little different CONFIG word setup and a little
different procedure to make PORTA pins digital i/o instead of analog.

For example:

;Program Configuration Register 1
 __CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF &
_WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF &
_PWRTE_ON & _WDT_OFF & _INTRC_IO

;Program Configuration Register 2
 __CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF

and for setting up PORTA to digital:

; select BANK 1 first
             movlw       0x00                ;All pins digital i/o for
now
             movwf       ANSEL & 0x7F
; don't forget to switch back to BANK 0



2007\03\07@113355 by Jan-Erik Soderholm

face picon face
Rikard Bosnjakovic wrote:

> That line is from the template-file from Microchip's MPLAB-tutorial, I
> have no idea what the values are so I left them untouched.

Then *learn* what the values stands for.

Use the part in the datasheet about the CONFIG together
with the rellevant part of the INC file for the device.

> It seems
> it's possible to change them from the menu...

Don't do that. Change the setting in the source code using
the __CONFIG directive. Much better when you come back
6 months later and you have no clue whatsoever what you
did in the menus...

Regards,
Jan-Erik.

2007\03\07@132911 by Herbert Graf

flavicon
face
On Wed, 2007-03-07 at 10:19 +0100, Rikard Bosnjakovic wrote:
> I've written a small assembly-code in MPLAB and simulate it. I open a
> watch-window (View->Watch) and add a couple of symbols and SFRs. To
> change the values, I simply double-click it and type in a new one.
> Works fine, except for PORTA. No matter which value I try to set in
> PORTA, it returns to the initial zero. Does this have something to do
> with that I've set MCLRE in the config word to zero, or what's the
> reason?

Unfortunately, without telling us WHICH PIC you are using it's pretty
much impossible to give truly useful responses.

TTYL

2007\03\07@205935 by Rikard Bosnjakovic

picon face
On 3/7/07, michael brown <spamBeGonen5qmgspamBeGonespamearthlink.net> wrote:

> Read about them, you need to know this stuff.  They're just like option
> switches, you turn them on or off.  You'll see that the CLKOUT stuff
> passes the Fosc/4 clock out a port pin making it unusable to you.  The
> ER thingy is also tying up one of your port pins thinking that you have
> an external R/C connected to act as the clock.  You could try this for
> your CONFIG word settings:

Thanks for your input. I've now read through about the configuration
bits and port setups even more. Yet I seem to miss something, because
PORTA won't change values when I try to.

   __CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON &
_INTOSC_OSC_NOCLKOUT & _MCLRE_OFF & _LVP_OFF

start
       clrf    PORTA
       clrf    PORTB

       ; reset and initialize ports
       bsf     STATUS, RP0                     ; select bank1 for
configuration of TRISA/TRISB
       bcf     STATUS, RP1

       movlw   b'00000111'
       movwf   CMCON                           ; turn off the
comparator function for PORTA

       movlw   b'11111000'                     ; RA[3:7] inputs
       movwf   TRISA                           ; RA[0:2] outputs

       movlw   b'00000000'                     ; RB[0:5] outputs
       movwf   TRISB                           ; RB[6:7] unusable
(timer crystal)
       bcf     STATUS, RP0

       ; none of these below works, PORTA is still 0
       movlw   1
       movwf   PORTA
       movlw   2
       movwf   PORTA
       movlw   3
       movwf   PORTA
       movlw   4
       movwf   PORTA
       movlw   5
       movwf   PORTA
       movlw   6
       movwf   PORTA
       movlw   7
       movwf   PORTA
       movlw   8
       movwf   PORTA
       movlw   9
       movwf   PORTA

Have I missed something obvious? Because I really can't understand
what's going on.


--
- Rikard.

2007\03\07@213738 by michael brown

picon face
Rikard Bosnjakovic wrote:
{Quote hidden}

CMCON is in BANK0 on the 16F628


>        movlw   b'11111000'                     ; RA[3:7] inputs
>        movwf   TRISA                           ; RA[0:2] outputs
>
>        movlw   b'00000000'                     ; RB[0:5] outputs
>        movwf   TRISB                           ; RB[6:7] unusable
> (timer crystal)
>        bcf     STATUS, RP0

You need to move the CMCON stuff to right here

{Quote hidden}

The 8 shouldn't work and the 9 below should result in only a 1 since you
only have three output bits.

>        movlw   9
>        movwf   PORTA
>
> Have I missed something obvious? Because I really can't understand
> what's going on.

Try the CMCON stuff, it'll work wonders.  ;-)

2007\03\07@214747 by Richard Prosser

picon face
I think some PICs powerup with PORTA set as analogue inputs & you need
to manually change them to digital if that's what you want.

Not 100% sure these days.

RP

On 08/03/07, Rikard Bosnjakovic <RemoveMErikard.bosnjakovicspamTakeThisOuTgmail.com> wrote:
{Quote hidden}

> -

2007\03\07@215832 by Rikard Bosnjakovic

picon face
On 3/8/07, michael brown <EraseMEn5qmgspamearthlink.net> wrote:

> The 8 shouldn't work and the 9 below should result in only a 1 since you
> only have three output bits.

That I was aware of, I just had the lines there for the sake of
curiousity and experimenting. You were right about the CMCON. Fixing
that quirk fixed the whole problem. Thanks.

Now I'm getting somewhere, still can't wait until I get the real chips.


--
- Rikard.

2007\03\07@223028 by Jinx

face picon face
>         ; reset and initialize ports
>         bsf     STATUS, RP0                     ; select bank1
>         bcf     STATUS, RP1

Rikard, you, like picnoob, really should start using banksel

banksel trisa will insert the above for you. You'd see this in
MPLAB's Program Memory window

BSF STATUS, 0x5
BCF STATUS, 0x6

banksel cmcon, etc

Unless you're really really short of space there's no reason
not to. In all the code I've ever written, and that is one heck
of a lot over the years, only once did I ever need to skimp
on a bank selection. In a very tight loop with one instruction
cycle to spare and could do only bsf or bcf status,rp0. That
was in a controlled situation where rp1 and irp didn't change

2007\03\08@063832 by michael brown

picon face
Rikard Bosnjakovic wrote:
> On 3/8/07, michael brown <RemoveMEn5qmgEraseMEspamEraseMEearthlink.net> wrote:
>
>> The 8 shouldn't work and the 9 below should result in only a 1 since
>> you only have three output bits.
>
> That I was aware of, I just had the lines there for the sake of
> curiousity and experimenting. You were right about the CMCON. Fixing
> that quirk fixed the whole problem. Thanks.
>
> Now I'm getting somewhere, still can't wait until I get the real
> chips.

Try not to let the frustration get you down, you will spend very much
time scratching your head when using these things.  Once you learn the
quirks, pitfalls and traps, these things are really quite amazing.  I
know the pages and banks are confusing right now, but you will learn and
then it won't seem so bad.  Soon, you'll wonder how you got by without
them.  At least that's how I feel anyway.  :-)

When you get your real chips, you will find what frustration is all
about.  ;-)  Just kidding, but it will get interesting.  Things will
work in the simulator that won't work in the real world.  For example,
in the real world you have to get your PIC to boot when power is
applied, the simulator has no such requirement.  This means that the
power supply has to ramp up faster than .05 V/mS (50V/S) so the device
will come out of reset, and the oscillator has to start (no problem on
the INTOSC, XTALs can be more fussy).  The real world will also let you
configure the PIC to use LVP, INTOSC and set /MCLR as an i/o pin, but
then the real world can lock you out of reprogramming it forever.  Yes
get ready for the real world.  ;-)

2007\03\08@070142 by wouter van ooijen

face picon face
> The real world will also let you
> configure the PIC to use LVP, INTOSC and set /MCLR as an i/o pin, but
> then the real world can lock you out of reprogramming it forever.

Not with a propper programmer.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



2007\03\08@075638 by michael brown

picon face
wouter van ooijen wrote:
>> The real world will also let you
>> configure the PIC to use LVP, INTOSC and set /MCLR as an i/o pin, but
>> then the real world can lock you out of reprogramming it forever.
>
> Not with a propper programmer.

I know I'm probably wrong, but I thought the only workaround for some
chips was to place a delay at the beginning of the program before making
use of some of the pins.  How does the programmer get control of the
chip before the oscillator starts and the program runs?

2007\03\08@155431 by wouter van ooijen

face picon face
>>> The real world will also let you
>>> configure the PIC to use LVP, INTOSC and set /MCLR as an i/o pin,
but
>>> then the real world can lock you out of reprogramming it forever.
>>
>> Not with a propper programmer.
>
> I know I'm probably wrong, but I thought the only workaround for some
> chips was to place a delay at the beginning of the program before
making
> use of some of the pins.  How does the programmer get control of the
> chip before the oscillator starts and the program runs?

By using the correct enter-programming sequence, check the programming
specs. In most cases this means: Vpp-before-Vdd.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



2007\03\08@163735 by peter green

flavicon
face


{Quote hidden}

in other words depending on the programming equipment and target cuircuit it is possible to get into real shit this way. Essentially the only ways out are either to be able to remove the chip to reprogram it, to have the PIC on an isolatable power rail or have a programmer that can power up the entire target cuircuit.

I'm sure having something like a proprog handy that can power up a significant target cuircuit will get you out of a few corners but ultimately people and especially those without a high grade programmer must remember there are corners they can paint themselves into that they will not get out of without desoldering the chip and either replacing it or putting it in a standalone programmer (and adaptors for putting smt chips in standalone programmers aren't cheap either) .

and life gets even worse if your target cuircuit is 3.3V because then you need a programmer that can do all the above while supplying 3.3V to the cuircuit and reprogramming the chip without using bulk erase (can the proprog do this?) and you'd better hope you didn't turn on code protection.

i belive some programmers (such as the ICD2) can't do VDD before VPP at all and some that can have pretty weedy or inflexible power supplies.

ultimately before disabling mclr especilly in combination with using the internal oscilator it is vital to consider the suitability of your programming arrangements.



2007\03\08@183136 by olin piclist

face picon face
peter green wrote:
> and life gets even worse if your target cuircuit is 3.3V because then
> you need a programmer that can do all the above while supplying 3.3V
> to the cuircuit and reprogramming the chip without using bulk erase
> (can the proprog do this?)

No, the ProProg always does a bulk erase.  The algorithms can get pretty
different if you try to erase then write parts of memory at a time, and
there are some states that can't be recovered from without bulk erase.  I
was afraid that if I supported the special algorithms to get around bulk
erase in for those cases where it is possible people wouldn't understand and
blame the programmer when they got to a case where this can't work, no
matter how much you try to document and explain this.  In the end I decided
it was better not to go there.  I felt the little gain was outweighed by the
much greater potential loss.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2007\03\09@015609 by wouter van ooijen

face picon face
> in other words depending on the programming equipment
> and target cuircuit it is possible to get into real shit this way.

Of course, but that is hardly anything new. Impropper tools can always
get you into shit.

> Essentially the only ways out are either to be able to remove the chip
to reprogram it, to have the PIC on an isolatable power rail or have a
programmer that can power up the entire target cuircuit.

Or have a short-term ( milliseconds) shorteable power. And note that
'isolatable' can mean just a 1..10 ohm ressistor between the PIC and the
power.

> and adaptors for putting smt chips in standalone programmers aren't
cheap either) .

for SOIC you can use a SOIC clip

> i belive some programmers (such as the ICD2) can't do VDD before VPP
at all

IIRC an ICD2 can't do that *when you configure it to use the target's
power*

> ultimately before disabling mclr especilly in combination with using
the internal oscilator it is vital to consider the suitability of your
programming arrangements.

correct. and if you find it inadequate now might be a good time to
switch...


Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



2007\03\09@191817 by Byron A Jeff

face picon face
On Wed, Mar 07, 2007 at 12:55:44PM +0100, Rikard Bosnjakovic wrote:
> On 3/7/07, Jan-Erik Soderholm <EraseMEjan-erik.soderholmspamspamspamBeGonetelia.com> wrote:
> > See (and read! :-) ) "Note 3" in the grey box on the page
> > with the description for PORTA in the datasheet.

> Ok, now I'm a bit confused as things seem to go way above my basic
> level of knowledge right now so I have no clue what to do.

Well let's take a stab at it.

> Scenario: I need 5 inputs and 11 outputs. PORTB is set to all outputs,
> so I have only PORTA left. 5 inputs and 3 outputs does fit, but I seem
> to lack the proper magic to configure the upper bits of PORTA.

Suggestion. A bigger chip would make your life easier here. Having portC
on a 28 pin chips simplifies everything.

> Feel free to point me to a place that helps me understand what I'm
> supposed to do and why. The datasheet is good as a reference, but
> since this is my first playground with a PIC, it tends to get very
> complicated very quickly.

Again this is another reason to look at a larger chip. I suggest to hobbyists
that 28 or 40 pin parts are your best friend. You don't have a need to
penny or space pinch for one off projects, and the simplification of
getting things going is worth both the extra space and the extra couple of
nickels for the larger parts.

Anyway to answer your question, extra 3 bits of PORTA are attached to pins
that have other primary functions, specifically the two clock pins and MCLR.
In order to configure those pins you have to repurpose their primary functions.

Let's take MCLR/RA5 first. On page 94 of this 16F628 datasheet:

http://ww1.microchip.com/downloads/en/devicedoc/40044b.pdf

shows that MCLRE controls the function of this bit. You need to clear MCLRE
in the config word to enable it.

The other two bits are attached to the oscillator. To repurpose them you
have to use an internal oscillator and configure the pins for I/O. Bit pattern
100 for oscillator selection chooses this.

But frankly you're shoehorning. Your best solution is a bigger part. Right now
I'm evaluating the 16F886 and 16F887 are the 28 and 40 pin parts that I'm
evaluating as my standards.

Hope this helps,

BAJ

2007\03\10@070730 by Byron A Jeff

face picon face
On Wed, Mar 07, 2007 at 02:57:09PM +0100, Rikard Bosnjakovic wrote:
> On 3/7/07, michael brown <RemoveMEn5qmgKILLspamspamearthlink.net> wrote:
>
> > Part of the problem is right here.  You need to use INTOSC to be able to
> > free up the OSC1 and OSC2 pins.  It is only two speeds (37kHx and 4MHz),
> > you set the speed using the OSCF bit in the PCON sfr.  So instead of
> > _ER_OSC_CLKOUT, you want something like "_INTRC_OSC_NOCLKOUT".  If the
> > assembler doesn't like that, try "_INTOSC_OSC_NOCLKOUT".  Microchip has
> > a problem with consitency on this stuff.  Be careful with that LVP_ON
> > stuff and trying to use /MCLR as an input pin, I'd change that too if I
> > were you.
>
> That line is from the template-file from Microchip's MPLAB-tutorial, I
> have no idea what the values are so I left them untouched. It seems
> it's possible to change them from the menu in case I need it (which I
> obviously seem to do).

Changing from the menu is bad mojo. Always configure the config bits in the
source file.

> But again, this is my first glance with PICs so I don't yet know all
> this kind of black magic (the datasheet is pretty heavyweight and I
> haven't got through it all).

Keep working on it. It'll serve you well.

> It does, however - according to what you
> write, look like I've run into a problem since I need a
> 32.768kHz-crystal.

You now have run into what I have been saying for over a week now: you have
the wrong sized chip.

Start your work with a 28 pin or 40 pin chip and you'll have less problems.
You'd have enough pins to drive your display, switches, and have Timer 1
available for that 32.768 kHz crystal too.

There's no good reason to remain cramped.

> I guess I'll have to trim down the inputs to three and multiplex them
> together using diodes. Ugh.

Exactly. Ugh. Upgrade your chip. As a hobbyist (which is the impression that
I've gotten so far) you work your way down the feature chain, not up.

Take a look at the 16F887 and 16F886. They will serve you well.

BAJ

2007\03\10@073355 by Jan-Erik Soderholm

face picon face
Byron A Jeff wrote:

> Take a look at the 16F887 and 16F886. They will serve you well.

They definitely are nice chips and a good "upgrade" to the
old and trusted 87x(A) series, but do check that whatever
programmer is used actualy support them ! They might also
be a little hard to source yet, well if not sampled,
of course... :-)

Jan-Erik.

2007\03\10@073835 by Jinx

face picon face
> > I guess I'll have to trim down the inputs to three and multiplex
> > them together using diodes. Ugh.
>
> Exactly. Ugh. Upgrade your chip

It's not too ugh is it BAJ ? 7 pushbuttons can be quite easily
matrixed into 3 inputs with diodes, and then it's simply a mask
and gotos in s/w ........

> you work your way down the feature chain, not up

....... but that's a good point for a beginner who has enough
to cope with getting the first project going. And especially with
prices being so low now for the larger chips

Rikard, have you tried to sample from Microchip ? They're
very generous with free micros (well, 4 I think is the maximum
per request) and you'd have them in a few days. I do it often,
never a problem

http://sample.microchip.com/

2007\03\10@093142 by olin piclist

face picon face
Jan-Erik Soderholm wrote:
> They definitely are nice chips and a good "upgrade" to the
> old and trusted 87x(A) series, but do check that whatever
> programmer is used actualy support them !

Anyone who has one of my programmers they got more than a few weeks ago will
have to update the software and firmware.  I just added support for the
16F88x subfamily recently.  Check http://www.embedinc.com/picprg/sw.htm for
details.

> They might also
> be a little hard to source yet, well if not sampled,
> of course... :-)

I had no problems getting samples from Microchip.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2007\03\10@104303 by Dario Greggio

face picon face
Olin Lathrop wrote:

>I had no problems getting samples from Microchip.
>  
>
me too

--
Ciao, Dario

2007\03\10@104942 by Byron A Jeff

face picon face
On Sat, Mar 10, 2007 at 01:33:46PM +0100, Jan-Erik Soderholm wrote:
> Byron A Jeff wrote:
>
> > Take a look at the 16F887 and 16F886. They will serve you well.
>
> They definitely are nice chips and a good "upgrade" to the
> old and trusted 87x(A) series, but do check that whatever
> programmer is used actualy support them ! They might also
> be a little hard to source yet, well if not sampled,
> of course... :-)

Jan-Erik,

I took a quick read of the programmer specification. These parts accept
each of the 1,4, and 8 word writes. AFAICT they are backwards compatible
with the 16F877 and 16F877A in terms of programming.

BAJ

2007\03\10@105016 by Byron A Jeff

face picon face
On Sat, Mar 10, 2007 at 04:42:55PM +0100, Dario Greggio wrote:
> Olin Lathrop wrote:
>
> >I had no problems getting samples from Microchip.
> >  
> >
> me too

me three. I have 3 16F887s and 3 16F886s for testing.

BAJ

2007\03\10@105729 by Byron A Jeff

face picon face
On Sun, Mar 11, 2007 at 01:37:18AM +1300, Jinx wrote:
> > > I guess I'll have to trim down the inputs to three and multiplex
> > > them together using diodes. Ugh.
> >
> > Exactly. Ugh. Upgrade your chip

> It's not too ugh is it BAJ?

Personally I think so. Rikard is clearly a hobbyist. As such simplicity
and straightforwardness are more important attributes in projects than
conserving space or money. He should work harder to keep things simple.
The easiest way to do that here is to have more I/O.

I firmly believe that hobby developers should operate from the largest
most feature packed chip. 10 years ago when there was only the 16F84A
for a PIC flash then using the 18 pin part made sense. But now with
28 and 40 pin dips, it doesn't.


> 7 pushbuttons can be quite easily
> matrixed into 3 inputs with diodes, and then it's simply a mask
> and gotos in s/w ........

But it's more difficult than simply assigning each switch their own
I/O pin. And the only thing that preventing Rikard from doing that is
the fact that he's working with a 16F628. Nothing else.

> > you work your way down the feature chain, not up

> ....... but that's a good point for a beginner who has enough
> to cope with getting the first project going. And especially with
> prices being so low now for the larger chips

Bingo. Start at the top and work your way down, not the other way around.

> Rikard, have you tried to sample from Microchip ? They're
> very generous with free micros (well, 4 I think is the maximum
> per request)

3 per part for up to 4 parts. So I'd suggest getting a set of 16F88, 16F886,
and 16F887 parts for starters. In fact that what I got in my last request
along with a set of the microchip ethernet chips to doodle with.

> and you'd have them in a few days. I do it often,  never a problem

Me neither.

> http://sample.microchip.com/

Excellent suggestion.

BAJ

2007\03\10@110601 by olin piclist

face picon face
Byron A Jeff wrote:
> I took a quick read of the programmer specification. These parts
> accept each of the 1,4, and 8 word writes. AFAICT they are backwards
> compatible with the 16F877 and 16F877A in terms of programming.

They are not.  Microchip's POD (Programming Obfuscation Division) has done
their usual superb job.  I had to assign these chips a new family type in
the host software and a new firmware write algorithm ID.  I don't remember
exactly, but I think there was something about the bulk erase procedure and
a different END PROGRAMMING command.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2007\03\10@123651 by Jan-Erik Soderholm

face picon face
Byron A Jeff wrote:

> I took a quick read of the programmer specification. These parts accept
> each of the 1,4, and 8 word writes. AFAICT they are backwards compatible
> with the 16F877 and 16F877A in terms of programming.

Right, maybe the basic programming routines. Now, Olin's post
points against that.

But there are other things, like size of (and the number of)
the config word(s). Most programmers usualy have a "mask" to
correctly verify the config word when read back. And the 87x
series has one config word, the 88x series has two words.

And anyway, even *if* the old 87x(A) would work, you'd like
to have that verified before getting (maybe buying) 88x chips.

Jan-Erik.


2007\03\10@170646 by Jinx

face picon face
> > > I guess I'll have to trim down the inputs to three and multiplex
> > > them together using diodes. Ugh.
> > >
> > > Exactly. Ugh. Upgrade your chip
>
> > It's not too ugh is it BAJ?
>
> Personally I think so. Rikard is clearly a hobbyist

Rikard did mention it first, so he's aware of the concept. I think
'ugh' is an over-reaction, just MHO

>10 years ago when there was only the 16F84A for a PIC flash
> then using the 18 pin part made sense

That's very true. This project dates from July 1997, when Microchip
were not long into F parts

http://home.clear.net.nz/pages/joecolquitt/0chaser.html

(sorry about page colours, will fix one day)

> But now with 28 and 40 pin dips, it doesn't

Absolutely spoiled for choice now, it's a sweet shop

2007\03\10@172849 by Byron A Jeff

face picon face
On Sat, Mar 10, 2007 at 11:06:57AM -0500, Olin Lathrop wrote:
> Byron A Jeff wrote:
> > I took a quick read of the programmer specification. These parts
> > accept each of the 1,4, and 8 word writes. AFAICT they are backwards
> > compatible with the 16F877 and 16F877A in terms of programming.
>
> They are not.  Microchip's POD (Programming Obfuscation Division) has done
> their usual superb job.  I had to assign these chips a new family type in
> the host software and a new firmware write algorithm ID.  I don't remember
> exactly, but I think there was something about the bulk erase procedure and
> a different END PROGRAMMING command.

Arrg! I didn't read it closely Olin because I wasn't programming at the time.

Thanks for the heads up. I guess I'll be writing yet another module for picprg
for these parts.

BAJ

2007\03\10@181134 by William Chops Westfield

face picon face

On Mar 10, 2007, at 7:57 AM, Byron A Jeff wrote:

>>> Exactly. Ugh. Upgrade your chip
>
>> It's not too ugh is it BAJ?
>
> Personally I think so. Rikard is clearly a hobbyist. As such simplicity
> and straightforwardness are more important attributes in projects than
> conserving space or money. He should work harder to keep things simple.
>
That all depends.  The fact that Rikard is a hobbyist makes it HARDER
to decide.  On the one hand, if he wants a clock, then he should just
use a chip with more pins.

However, if he's trying to learn some of the "ticks of the trade"
commonly used with small microcontrollers, and the clock is just
a recognizable goal, then figuring out how to multiplex all his
functions onto the pins of an 18pin PIC is a fine puzzle.  Maybe
not a great FIRST project, but not totally out of reach either.

(On the third hand, it's becoming increasingly difficult to decide
whether to go for more pins or external electronics on a lot of
projects regardless of experience level, IMO.)

Here's a hint that MIGHT help.  You can treat your switches as an
N+1th digit of your multiplexed display, or one switch on each
digit as an 8th segment, and scan the switches as part of the same
code that multiplexes the output...

BillW

2007\03\10@234447 by Rikard Bosnjakovic

picon face
On 3/10/07, Byron A Jeff <byronSTOPspamspamspam_OUTcc.gatech.edu> wrote:

> Exactly. Ugh. Upgrade your chip. As a hobbyist (which is the impression that
> I've gotten so far) you work your way down the feature chain, not up.
>
> Take a look at the 16F887 and 16F886. They will serve you well.

I will do that now, since someone posted the link to Microchip
samples. The prices for a uC are steep here in Sweden, not $1.5 or
whatever someone wrote for a bigger chip. If I was about to buy a
single 877A, I would have to pay $17 including shipping. That together
with the fact that I bought 10 16F628A "cheap" on ebay is the reason I
can't "get just another chip" so easily.

As a hobbyist, I don't have this huge fortune letting me buy
everything I want, but sampling from Microchip seems like it worked
and I'm now waiting for the chips to arrive. Thanks for the pointer.


--
- Rikard.

2007\03\10@234859 by Rikard Bosnjakovic

picon face
On 3/11/07, William Chops Westfield <spamBeGonewestfwSTOPspamspamEraseMEmac.com> wrote:

> Here's a hint that MIGHT help.  You can treat your switches as an
> N+1th digit of your multiplexed display, or one switch on each
> digit as an 8th segment, and scan the switches as part of the same
> code that multiplexes the output...

I solved it like this (atleast in theory, haven't tested it in
practice yet): I had 5 switches with each one input. I reduced it to
three inputs and used a simple truthtable for recognizing which switch
is on:

RA7 - "A"
RA6 - "B"
RA5 - "C"
SW1 = A, SW2 = B, SW3 = A+C, SW4 = B+C, SW5 = A+B+C

; PORTA[5:7] - Mechanical switches
SW_START    equ     b'00100000'
SW_STOP     equ     b'01000000'
SW_UP       equ     b'10100000'
SW_DOWN     equ     b'01100000'
SW_RESET    equ     b'11100000'

[.....]

       movlw   SW_RESET
       xorwf   PORTA, w
       btfsc   STATUS, Z                       ; is the reset-switch pressed?
        goto   switch_reset

Atleast I think it should work.

--
- Rikard.

2007\03\11@075849 by Jan-Erik Soderholm

face picon face
Rikard Bosnjakovic wrote:

> The prices for a uC are steep here in Sweden, not $1.5 or
> whatever someone wrote for a bigger chip. If I was about to buy a
> single 877A, I would have to pay $17 including shipping.

More like aprox $15 incl shipping.
http://www.jescab.se/Prod_PIC.html

Regards / Mvh
Jan-Erik.

2007\03\11@084748 by Byron A Jeff

face picon face
On Sun, Mar 11, 2007 at 05:44:45AM +0100, Rikard Bosnjakovic wrote:
> On 3/10/07, Byron A Jeff <KILLspambyronspamBeGonespamcc.gatech.edu> wrote:
>
> > Exactly. Ugh. Upgrade your chip. As a hobbyist (which is the impression that
> > I've gotten so far) you work your way down the feature chain, not up.
> >
> > Take a look at the 16F887 and 16F886. They will serve you well.
>
> I will do that now, since someone posted the link to Microchip
> samples. The prices for a uC are steep here in Sweden, not $1.5 or
> whatever someone wrote for a bigger chip. If I was about to buy a
> single 877A, I would have to pay $17 including shipping. That together
> with the fact that I bought 10 16F628A "cheap" on ebay is the reason I
> can't "get just another chip" so easily.

Understood. Help me in understanding the process. What was "cheap" on Ebay?
Where were they shipping from? And how much was the shipping?

I'm just curious now what's the minimum cost to ship something to you from
the US.

BTW those 16F628A's are useful. I think that for hobbyist that the 16F88
should be the stock 16F 18 pin package as it carries the most memory. But
16F628s will serve you well in a variety of smaller projects.


> As a hobbyist, I don't have this huge fortune letting me buy
> everything I want, but sampling from Microchip seems like it worked
> and I'm now waiting for the chips to arrive. Thanks for the pointer.

Glad to help.

BTW what programmer did you finally settle on using?

BAJ

2007\03\11@085320 by Rikard Bosnjakovic

picon face
On 3/11/07, Jan-Erik Soderholm <EraseMEjan-erik.soderholmspamEraseMEtelia.com> wrote:

> More like aprox $15 incl shipping.
> http://www.jescab.se/Prod_PIC.html

That was the URL I used when calculating:  A 16F877A - 89:-, shipping
35:- (124 total).

$ currency.py sek usd 124
124 Sweden Kronor = 17.4704 United States Dollars

Now I'm just hoping that Microchip accepts my sampling, despite the
fact that I'm not a company. In that case, it'll all end up fine in a
way or another.


--
- Rikard.

2007\03\11@090548 by Rikard Bosnjakovic

picon face
On 3/11/07, Byron A Jeff <@spam@byron@spam@spamspam_OUTcc.gatech.edu> wrote:

> Understood. Help me in understanding the process. What was "cheap" on Ebay?
> Where were they shipping from? And how much was the shipping?

I paid $24.32 for 8 pieces with shipping from Hong Kong included
($2.49 each w/o shipping). I think that was a reasonable price,
compared to what I would have to pay if I bought them off the shelf
here in Sweden.

> I'm just curious now what's the minimum cost to ship something to you from
> the US.

I have never bought anything directly from a company so I wouldn't
know except that Digikey et all have huge fixed shipping costs to
other countries than US. At other companies (i.e. via Ebay) the
shipping seems to vary a lot because some people like to overcharge
you when it comes to shipping and handling, while some other never
charge more than what the USPO would have done. And for the latter,
it's cheap for small packets.

> BTW those 16F628A's are useful. I think that for hobbyist that the 16F88
> should be the stock 16F 18 pin package as it carries the most memory. But
> 16F628s will serve you well in a variety of smaller projects.

I'm still not finished, but I haven't passed 160 bytes yet, so there's
still lot of place on it ;-)

> BTW what programmer did you finally settle on using?

I randomly picked one on Ebay that's got USB and a fair pricing. I
think it's some kind of pirate version, but I don't mind. I paid less
than 25% of what it would have to buy the similiar Picstart-bundle
from Microchip. Also, I didn't want to mess around with those
DIY-programmers that floats around the web. Perhaps I will build one
once I start to get the hang of this fun area, but until I get going
I'm buying finished (and probably working) things first.

Ebay-link: http://tinyurl.com/2o88zs



--
- Rikard.

2007\03\11@091231 by wouter van ooijen

face picon face
> The prices for a uC are steep here in Sweden, not $1.5 or whatever
> someone wrote for a bigger chip. If I was about to buy a single 877A,
> I would have to pay $17 including shipping.

So consider
- alternative chips, maybe 16F917
- buy more than 1 chip
- buy elsewhere, I think you will buy mail-order anyway, so unless you
are in a hurry it doesn't matter whether you buy in Sweden or Australia.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



2007\03\11@184453 by William Chops Westfield

face picon face

>> I bought 10 16F628A "cheap"

You could consider building your clock with TWO 16F628s.  One
could do timing and buttons, and the other (most of?) the display.

BillW

2007\03\13@063535 by Byron A Jeff

face picon face
On Sun, Mar 11, 2007 at 02:05:40PM +0100, Rikard Bosnjakovic wrote:
> On 3/11/07, Byron A Jeff <spamBeGonebyronspamKILLspamcc.gatech.edu> wrote:
>
> > Understood. Help me in understanding the process. What was "cheap" on Ebay?
> > Where were they shipping from? And how much was the shipping?
>
> I paid $24.32 for 8 pieces with shipping from Hong Kong included
> ($2.49 each w/o shipping). I think that was a reasonable price,
> compared to what I would have to pay if I bought them off the shelf
> here in Sweden.

What was the shipping? I spent 5 minutes trying to cost shipping a small
box from the US to Stockholm. The cheapest price I got was something like
$67 USD. I almost choked on my coffee.

{Quote hidden}

Maybe I should give the USPO a quick look.

> > BTW those 16F628A's are useful. I think that for hobbyist that the 16F88
> > should be the stock 16F 18 pin package as it carries the most memory. But
> > 16F628s will serve you well in a variety of smaller projects.
>
> I'm still not finished, but I haven't passed 160 bytes yet, so there's
> still lot of place on it ;-)

This is true only until you get a project that fills up the available memory.

> > BTW what programmer did you finally settle on using?

> I randomly picked one on Ebay that's got USB and a fair pricing. I
> think it's some kind of pirate version, but I don't mind. I paid less
> than 25% of what it would have to buy the similiar Picstart-bundle
> from Microchip.

Hope it works out for you.

> Also, I didn't want to mess around with those
> DIY-programmers that floats around the web.

I certainly represent that remark as the maintainer of one of those DIY
programmers.

> Perhaps I will build one
> once I start to get the hang of this fun area,

My suggestion is don't bother. IMHO programmers are a highly overrated aspect
of uC development, subject to intense debate over virtually nothing. My
personal interest is making programming as hassle free and transparent as
possible. It's one reason I'm partial to bootloaders. I'm planning on spending
some time following up on a thread that Wouter, Olin, and others were
discussing a few weeks ago, which is a true zero I/O pin bootloader that uses
only the power pin to load programs.

> but until I get going
> I'm buying finished (and probably working) things first.

Not a bad move. There's always a balance between money, time, and frustration.
DIY is for those who have lots of the latter two and virtually none of the
first.

BAJ

2007\03\13@065301 by Howard Winter

face
flavicon
picon face
BAJ,

On Tue, 13 Mar 2007 06:35:32 -0400, Byron A Jeff wrote:

>...
> > I paid $24.32 for 8 pieces with shipping from Hong Kong included
> > ($2.49 each w/o shipping). I think that was a reasonable price,
> > compared to what I would have to pay if I bought them off the shelf
> > here in Sweden.
>
> What was the shipping? I spent 5 minutes trying to cost shipping a small
> box from the US to Stockholm. The cheapest price I got was something like
> $67 USD. I almost choked on my coffee.

I always ask for people to send stuff from the USA to me using Global Priority - they have flat-rate envelopes (and boxes, I believe) and they are
remarkably good value - an average order from Glitchbuster would be $5.95, or $9.95 for a larger one.  And they're fast too - usually 3 to 5 days.  I
assume Sweden wouldn't be any more expensive as a destination than England!  :-)

Cheers,


Howard Winter
St.Albans, England


2007\03\13@071508 by Jan-Erik Soderholm

face picon face
I alsways use http://ircalc.usps.gov/ for all my
shipping calculations US -> Sweden. You get all
options listen for a given weight on the same page.

Just select "letter" och "package", enter the weight
and press "Calculate"...

Best Regards,
Jan-Erik.



Howard Winter wrote:
{Quote hidden}

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