Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Would you like to write a PIC book with me?

Status
Not open for further replies.
well as I'm new to pics I don't know if 18F is more difficult to program in assembly than 16F pics
but I think one 16F should be mentioned
 
Thunderchild said:
well as I'm new to pics I don't know if 18F is more difficult to program in assembly than 16F pics
but I think one 16F should be mentioned

Ahh there's the popular belief, IMO the 18F is no harder to learn than a modern 16F.
The minimal need for bank switching and that RAM starts at 0x00 helps.
You also never need to worry about RMW if you use LATx
The 18F was designed with C in mind and you can even get a decent free C18 compiler.
IMO the 18F1320 is a nice 18pin starter chip, it's not as fully featured as many (no comparators, no SPI, no internal clock 4xPLL :( ) but it's still a great chip to start with.
 
Yes, it's good to have the knowledge of 14-bit core's 35 instructions. Many of the 75 instructions in 18F are similar to 16Fs'. The bank switching in PIC18 makes my life easier. When using PIC16, I always check the datasheet for the bank of that particular register (even the 'find' of pdf can be used, but it is still time consuming).
I don't know C18, even haven't used all the 75 instructions in PIC18 :p
 
bananasiong said:
Yes, it's good to have the knowledge of 14-bit core's 35 instructions. Many of the 75 instructions in 18F are similar to 16Fs'. The bank switching in PIC18 makes my life easier. When using PIC16, I always check the datasheet for the bank of that particular register (even the 'find' of pdf can be used, but it is still time consuming).
I don't know C18, even haven't used all the 75 instructions in PIC18 :p

exactly learning the 16F MCUs is 2/3 the way of learning the 18F as you already know the MCU architechture and half the instructions
 
I've got to start posting 18F tips of the day.
Todays:
You can treat W just like any other file register.
Eg:
Code:
decfsz WREG

Very handy for delay routines...
 
blueroomelectronics said:
I've got to start posting 18F tips of the day.
Todays:
You can treat W just like any other file register.
Eg:
Code:
decfsz WREG

Very handy for delay routines...
Oh really??!!?? I didn't know about this even I'm using a PIC18 :p
Is this applied for all the instructions that associated with the RAM?

Is WREG defined in the include file? Or can I straight away use w?
 
You can use WREG right away it is defined in the .inc file, it's just another SFR in the 18F and above PICs. I got the idea from Pommies servo program (he does it with the 16F PIC using an addlw $FF sneaky)
Code:
Delay        
    dcfsnz  WREG    
    return              
    bra     Delay
 
Oh I see, thanks ;)
I'm using the Delay part of Pommie's servo program as well. Still remember it is 8*w instruction cycle :)
Didn't notice WREG in 18F, seems I have to somehow modify my program especially the delay part.
 
This was such a great project, what ever happened to it? Is there anything I can do to help it get on track again?
 
if you guys did this i'd get it and make a donation regardless. i've found it a bit tricky finding pic info and making a free information book would be a really big help for all of us new people. i was deathly afraid of pics when i started so i went with a bs2. now i know how inefficient they are and how much cheaper/better pics alone are.
 
You should come up with a list of subjects, in relative order, then we could give suggestions on what to include.

Here are some of the things I had to learn when starting with ucontrollers.

  • Choosing a Crystal (and the appropriate Decoupling Capacitors)
  • Issues with stray capacitance on breadboards
  • Setting up the Internal Oscillator
  • Turning off unused features (like the Comparators)
  • Making Ports Analog/Digital
  • Setting up Interrupts (learning that there is no vector table on 18f and lower).
  • Setting up/Reading the ADC
  • Using an LCD(HD44780) 4bit/8bit modes
There are more, but I cant think of any more this late at night, anyways.

I also think that maybe you should try and make it more abstract, and not focus on a specific device when talking about a topic, then after the theory you could have links to source-code for specific pic devices in specific languages.

i.e. You could talk about setting up and reading from the ADC by talking about setting certain registers, then reading from certain memory locations etc.. Then you could provide asm code for 1 or 2 popular 16f's and 18f's, then some ansi C code for 16f's and 18f's.

This is an idea I have been toying with since I have started to rewrite my PIC libraries, by creating a tutorial then tacking my code on it.
 
If you write this book please do not make it hard to understand. I had to take a microcontroller course and I hated it because the book we used, "PIC Microcontroller: An Introduction to Software & Hardware Interfacing" is the worst book at communicating to the reader how to program a pic. The author of that book assumed too much of prior knowledge of the reader. So please make your book NOOB friendly....
 
SuperTech said:
If you write this book please do not make it hard to understand. I had to take a microcontroller course and I hated it because the book we used, "PIC Microcontroller: An Introduction to Software & Hardware Interfacing" is the worst book at communicating to the reader how to program a pic. The author of that book assumed too much of prior knowledge of the reader. So please make your book NOOB friendly....

This book is focus on the PIC 18F series, it might be bit advance for absolute beginners.
 
Actually the 18F series PICs are easier than the 16F IMO. I thought the same thing ages ago but the 18F feels right, great compilers and the free versions of C18 & Swordfish BASIC are awesome.
 
blueroomelectronics said:
Actually the 18F series PICs are easier than the 16F IMO. I thought the same thing ages ago but the 18F feels right, great compilers and the free versions of C18 & Swordfish BASIC are awesome.


Would it be easier for an absolute beginner to start with the 16F series? Or is it better to start with the 18F series?

I mean a beginner might be overwhelmed by so much new features the 18F series have.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top