what uC do you prefer?

J

Jonathan Kirwan

Jan 1, 1970
0
<snip>
I used to mentally assemble PDP-11 programs and toggle them in, the
instruction set was that elegant. That's not likely on a 68K.

I still like the idea of a usable front panel, with switches designed
for human convenience. (None of those stupid metal bathandle things
that were used on the Altair 8800 front panel, which caused callouses
as though I were a heavy guitar player without a pick.) Some of the
earlier PDP-11 systems included a great front panel. I also liked the
HP 2116 front panel, as well -- lights inside the buttons, so that
when you pressed the button the light inside it would either go on or
off to indicate toggling the bit.

I also used to use an AM radio placed nearby to "hear" my programs. I
learned to "understand" the sound of certain routines operating and
could very easily detect a "crash."

Jon
 
M

Michael A. Terrell

Jan 1, 1970
0
Jonathan said:
I also used to use an AM radio placed nearby to "hear" my programs. I
learned to "understand" the sound of certain routines operating and
could very easily detect a "crash."


It sounded like 'heavy metal'?


--
Service to my country? Been there, Done that, and I've got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
 
J

Jonathan Kirwan

Jan 1, 1970
0
<snip>
I just enjoy knowing a little
something about how they work inside.

All this reminded me... I don't have a copy of "The Design of an
Optimizing Compiler." It's a smallish book on the BLISS compiler,
circa 1975. If anyone has a copy they want to sell off....

Jon
 
B

Ben Jackson

Jan 1, 1970
0
I agree 100%. If you can afford a professional C environment for PIC,
that might make a difference, but the freely available PIC C compiler
(SDCC) is crap. Being able to develop for AVR with a real toolchain
is very nice.

Also, if you're cheap, it's much easier to build a simple AVR programmer
than a simple PIC programmer.
I did look at AVR stuff last night but they dodn't offer much over the
PIC that we currently use heavilly in our controller designs. - did I
miss something?

I only ever write assembler - control freak that I am :eek:)

Well, 32 registers instead of 1, real memory addressing modes, no banking,
better access to the code space for data, ... One cycle per clock (not
1 per 4 clocks), almost all peripherals can operate on the input clock
instead of only Fc/4. As far as available integrated peripherals, you
may not find an advantage. I think PIC took an early lead in that area,
and along with the 16F74 won the hobbiest market.
 
R

Robin

Jan 1, 1970
0
I did look at AVR stuff last night but they dodn't offer much over the
PIC that we currently use heavilly in our controller designs. - did I
miss something?

I only ever write assembler - control freak that I am :eek:)

Quite right too - for the tiny devices with e.g. a stack dept of 8, I
don't see how any HLL could be made to work properly.

You might be into this already? But a good plan is to build up a
libraries of routines as macros. Then you can declare them in *any*
order at the start (forward references are allowed - because they are
not compiled).

Then insert them, as required, in your main code.

E.g.


; start of file called e.g. macro_library
;************************************************************************

; bulk left rotate
* *

;********************
*

; Rotate 65 bits of table + C to the
left. *

; The carry enters the lsb of
table[0]. *

; table[7] outputs its msb into the
carry. *

;
*

; Entry: M......L <--C table[0] prepare C for lr into lsb of
table[0] *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

; M......L
table[7] *

;
*

; Exit ......LC
table[0] *

; ......LM
*

; ......LM
*

; ......LM
*

; ......LM
*

; ......LM
*

; ......LM
*

; C <-- ......LM table[7] C now contains old msb of
table[7] *

;************************************************************************

blk_lr_tbl macro s ;bulk left rotate 8 bytes, one bit

bnk_tbl_st s ;init FSR to start of table

blk_lr_tbl_10

rlf INDF,f

incf FSR,f

skif_b3_changes s

goto blk_lr_tbl_10

return

endm



bnk_tbl_st macro s ;point FSR at table start

movlw s

movwf FSR

endm



;************************************************************************

; bulk right rotate, carry copied into msb
* *

;*******************************************
*

; Rotate 64 bits of table
right. *

; The lsb of table[0] enters the msb of
table[7]. *

; table[0] outputs its lsb into the
carry. *

;
*

; Entry: M......X
table[0] *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

; M......L
table[7] *

;
*

; Exit LM...... -->C table[0] C ==
X *

;
LM...... *

;
LM...... *

;
LM...... *

;
LM...... *

;
LM...... *

;
LM...... *

; XM......
table[7] *

;************************************************************************

blk_rr_tbl_pure macro s ;bulk right rotate 64 bits, one bit

bk_rr_tbl s

bsf (s + D'7'),7 ;

btfss STATUS,stat_C_bit ;

bcf (s + D'7'),7 ;

return

endm



;************************************************************************

; bulk right rotate
* *

;********************
*

; Rotate 65 bits of table + C
right. *

; The carry enters the msb of
table[7]. *

; table[0] outputs its lsb into the
carry. *

;
*

; Entry: M......X
table[0] *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

;
M......L *

; C--> M......L table[7] prepare C for rr into msb of
table[7] *

;
*

; Exit LM...... -->C table[0] C contains lsb that was in
table[0] *

;
LM...... *

;
LM...... *

;
LM...... *

;
LM...... *

;
LM...... *

;
LM...... *

; CM......
table[7] *

;************************************************************************

blk_rr_tbl macro s ;bulk right rotate 65 bits, one bit

bk_rr_tbl s

; return

endm



bk_rr_tbl macro s

local bk_rr_tbl_10

bnk_tbl_end s

bk_rr_tbl_10

rrf INDF,f ;rotate C into msb-end from highest
byte

decf FSR,f ;move down the table

skif_b3_changes s

goto bk_rr_tbl_10

endm



bnk_tbl_end macro s ;point FSR at table end

movlw (s + D'7')

movwf FSR

endm



;************************************************************************

; End of bulk right
rotate *

;************************************************************************



;************************************************************************

; compare table macro
* *

;**********************
*

; Compare one eight byte table with another 8 byte table. The
tables *

; must lie on "MOD 8 boundaries" e.g. 0x40 or
0x48 *

;
*

; Conditional assembly to ensure that the correct bxf and
btfsx *

; instructions match the table's
locations. *

;
*

; Form:
comp_tab(table[8],table[8]) *

;
*

; Entry: bank_x == don't
care *

; table == ((any_address MOD 8) ==
0) *

;
*

; Exit: (table_x == table_y) ? Z == true : Z ==
false *

; bank_x ==
unaltered *

;************************************************************************

Compare_data macro s,d ;Compares 8 bytes of bank1 upper to
lower

local compare_data_10

local compare_data_20

bnk_tbl_st s

compare_data_10

set_fsr_source

movf INDF,w ;get source

set_fsr_dest

subwf INDF,w ;compare

btfss STATUS,stat_Z_bit ;skif zero

goto compare_data_20 ;Exit, compare failed with Z=0

incf FSR,f

skif_b3_changes d

goto compare_data_10 ;

clrw ;set Z

compare_data_20

return

endm

;************************************************************************

; End of copare
tables *

;************************************************************************



;************************************************************************

; copy table
* *

;*************
*

; Copy one eight byte table to another 8 byte table. The tables must
lie*

; on "MOD 8 boundaries" e.g. 0x40 or
0x48 *

;
*

; Conditional assembly to ensure that the correct bxf and
btfsx *

; instructions match the table's
locations. *

;
*

; Form: copy_tab(source,
destination) *

;
*

; Entry: bank_x == don't
care *

; source == ((any_address MOD 8) ==
0) *

; destination == ((any_address MOD 8) ==
0) *

;
*

; Exit: destination[7,0] ==
source[7,0] *

; bank_x ==
unaltered *

;************************************************************************

copy_tab macro s,d

local copy_tab_10

bnk_tbl_st s

copy_tab_10

set_fsr_source

movf INDF,w ;get source

set_fsr_dest

movwf INDF ;put destination

incf FSR,f

skif_b3_changes d

goto copy_tab_10

; return

endm

;************************************************************************

; End of copy_tab
macro *

;************************************************************************





;************************************************************************

; clear table
* *

;**************
*

; Clear eight byte table. The tables must lie on "MOD 8
boundaries" *

; e.g. 0x40 or
0x48 *

;
*

; Conditional assembly to ensure that the correct bxf and
btfsx *

; instructions match the table's
locations. *

;
*

; Form:
clr_tab(source) *

;
*

; Entry: bank_x == don't
care *

; source == ((any_address MOD 8) ==
0) *

;
*

; Exit: source[7,0] ==
0 *

; bank_x ==
unaltered *

;************************************************************************

clr_tab macro s

local clr_tab_10

bnk_tbl_st s

clr_tab_10

clrf INDF

incf FSR,f

skif_b3_changes s

goto clr_tab_10

return

endm

;************************************************************************

; End of clr_tab
macro *

;************************************************************************





set_fsr_source macro

if((d & H'40') < (s & H'40')) ;

bsf FSR,6 ;

endif ;

if((d & H'20') < (s & H'20')) ;

bsf FSR,5 ;

endif ;

if((d & H'10') < (s & H'10')) ;

bsf FSR,4 ;

endif ;

if((d & H'08') < (s & H'08')) ;

bsf FSR,3 ;

endif ;



if((d & H'40') > (s & H'40')) ;

bcf FSR,6 ;

endif ;

if((d & H'20') > (s & H'20')) ;

bcf FSR,5 ;

endif ;

if((d & H'10') > (s & H'10')) ;

bcf FSR,4 ;

endif ;

if((d & H'08') > (s & H'08')) ;

bcf FSR,3 ;

endif ;

endm



set_fsr_dest macro

if((d & H'40') < (s & H'40')) ;

bcf FSR,6 ;

endif ;

if((d & H'20') < (s & H'20')) ;

bcf FSR,5 ;

endif ;

if((d & H'10') < (s & H'10')) ;

bcf FSR,4 ;

endif ;

if((d & H'08') < (s & H'08')) ;

bcf FSR,3 ;

endif ;



if((d & H'40') > (s & H'40')) ;

bsf FSR,6 ;

endif ;

if((d & H'20') > (s & H'20')) ;

bsf FSR,5 ;

endif ;

if((d & H'10') > (s & H'10')) ;

bsf FSR,4 ;

endif ;

if((d & H'08') > (s & H'08')) ;

bsf FSR,3 ;

endif ;

endm



skif_b3_changes macro t ;Insert apt btfsx instruction to suit
parameter

if(D'8' & t) ;

btfsc FSR,3 ;if(bit 3) then insert this

else ;

btfss FSR,3 ;if(!bit 3) then insert this

endif

endm





;************************************************************************

; jumper: goto(here + offset_in_W)
* *

;***********************************
*

; Computed goto (see
AN556). *

;
*

; Expects: W ==
offset *

; jumptable == concatenated to this
macro *

;
*

; Uses:
temp *

;************************************************************************

jumper macro

local jumper_10

local jumptable

movwf temp

movlw LOW jumper_10

addwf temp,w

movlw HIGH jumper_10

btfsc STATUS,stat_C_bit

addlw D'1'

movwf PCLATH

movf temp,w

jumper_10

addwf PCL,f

jumptable ; jump table starts here.

endm



;************************************************************************

; End of
jumper *

;************************************************************************



;************************************************************************

; End of macro
library *

;************************************************************************


; end of file called e.g. macro_library

Cheers
Robin
 
A

Allen Bong

Jan 1, 1970
0
All this reminded me... I don't have a copy of "The Design of an
Optimizing Compiler." It's a smallish book on the BLISS compiler,
circa 1975. If anyone has a copy they want to sell off....

Jon

All this reminded me... I don't have a copy of "The Design of an
Optimizing Compiler." It's a smallish book on the BLISS compiler,
circa 1975. If anyone has a copy they want to sell off....

Jon

You can get it used for $39.00. Too expensive?

http://www.amazon.com/gp/offer-listing/0444001581/ref=dp_olp_3/105-7280234-6086831

Allen
 
J

Jonathan Kirwan

Jan 1, 1970
0
All this reminded me... I don't have a copy of "The Design of an
Optimizing Compiler." It's a smallish book on the BLISS compiler,
circa 1975. If anyone has a copy they want to sell off....

Jon

You can get it used for $39.00. Too expensive?

http://www.amazon.com/gp/offer-listing/0444001581/ref=dp_olp_3/105-7280234-6086831

No, but marked up, I think. (Yes, I'd already checked amazon and read
something on that one about 'highlighting.' I'm looking for something
that is in fine or better condition. If you look over the list at
Amazon you will see the price is a bit higher by the time you see some
comments that clearly note at least the idea of 'clean pages.') I
also checked powells, which is a local outlet for me, and they don't
have any at all.

And partly, I'm curious also about who exactly here might actually
have a copy, as well. So there were two birds to strike in this
comment, not just one.

Jon
 
R

Rich Grise

Jan 1, 1970
0
So with the plethora of micro-controllers out there, which do you
use/prefer and why?

I use PICs pretty much exclusively but I just had a look at ATMELs range -
to be honest, I don't see any reason to change from what I know - am I
missing anything?

Do all uCs use harvard architecture? Sometimes it would be nuice to have
data available as bytes without having to wrap it in code and form tables.
Tonight I scared myself - I caught myself googling "microcontroller z80
core" eek!

All of my favorites are obsolete now, but I have to admit there wasn't all
that much difference. I've done 8051, Z80, 68HC11, and 80186
professionally, and they all have their good points and less good points. ;-)
For hobby stuff, I really liked the 6502, at least for its app as a
keyboard scanner. ;-)

Oh, yeah, I once made a FIFO with an 8748.

But I've looked at PIC, and I wouldn't spec one even if I were under
duress: Bank switching is Evil.

Cheers!
Rich
 
R

Rich Grise

Jan 1, 1970
0
Why would any intelligent person fret over an instruction set ?

Presumably, for reasons that aren't comprehensible to the unintelligent. ;-)

Hope This Helps!
Rich
 
Top