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.

MCU address

Status
Not open for further replies.

keny

New Member
hello

TRISD=0b11111110;

WHY. Why are these numbers like this? Is this Hexibinary? Myke predko does not explain. Actually Myke does not explain anything. I feel like I am trying to learn from a lion. Can somebody please write a helpful book???

I want to know:
Where I can find a guide to these locations.

i also want to know how to get my project working, which is acting strangs, and I'm pretty sure its a configuration word issue.

I was using a PIC16 previously but am now using a PIC18f2550 i want PORTA and PORTB to be outputs Port a goes straight to the 4 of a 5x4 LED matrix and port b goes to a HCT138 binary decoder where all is high unless you send it a signal. It worked beautifully on a pic 16 but I can't seem to get it right now. What commands should I use to:

turn tristate mode on
set all pins on PORT A and B to Output
Turn comparators off
Turn A/D's off

the 2550 is similar to the 4550 just fewer pins. I have succeeded at this project:
Open Source Framework for USB Generic HID devices based on the PIC18F and Windows - WFFwiki

but now I need to have a separate chip scan the lighting scenario and I need it to do what I want first before I delve into either USART or I2c...

Thanks for all the help, when i get better i'll help others but now im still a nooB
 
hi Ken
TRISD=0b11111110;

WHY. Why are these numbers like this? Is this Hexibinary? Myke predko does not explain. Actually Myke does not explain anything. I feel like I am trying to learn from a lion. Can somebody please write a helpful book???

I want to know:
Where I can find a guide to these locations.

The TRISD sets the PORT pins as inputs or output, so starting at the most significant bit D7

its 7,6,5,4,3,2,1,0 so in your example D7,6,5,4,3,2,1 are Inputs and D0 is an Output

An easy way to remember is 1_nput and 0_utput

Get the PIC's datasheet from Microchip Technology Inc. is a Leading Provider of Microcontroller and Analog Semiconductors, providing low-risk product development, lower total system cost and faster time to market for thousands of diverse customer applications worldwide.

I think most of us would agree with you about that book.!!
Its useful as a door stop.

EDIT:
This is a ebook: https://www.mikroe.com/en/books/picmcubook/
 
Last edited:
Eric,

Thanks for the information. I actually had the datasheet printed and bound. It has been helpful but basically, I have a lot of things on my plate for this project. It's my first EE job and I need to get a lot of stuff together fast. (basically getting my ass kicked, but loving it at the same time) the book looks helpful, too.

questions:

whats the "0b" for in TRISD=0b11111110;
I have seen several examples that turn A/D's and Comparators off. Why? Are they on by default?
In MPLAB what is the purpose of the configuration bits window?
Are there any O'reilly format books (or any other authors) to embedded programming with microchip?
Am I stuck with Hi-Tech C? Is there anything else that I can use?

Inquiring minds want to know...

Regards,
Keny
 
ooooh Help files!!! i guess i got so used to not good help files I didnt think to look there. It appears that they put some time into them!!!

i guess a lot of what is confusing me about this process is that i am writing in C and all the microchip data sheet example are in assembler, which i am not too familiar with...
Thanks!
 
so i went to the bookstore and they happened to have this book there about programming pics. It's at least a hundred times better than Myke "the lion" Predko:

Designing embedded systems with PIC microcontrollers, Tim Wilmshurst.

Rock. I got my BOOK configuration bit straight, now on to learning assembler....
 
the confusion thing I found in learning assembly language (and C for that matter) is the difference between compiler/assembler directives and the actual assembly language itself.

0b tells the compiler/assembler that the number you are just about to give it is binary, and not, in your case, 11 million... etc

The 0x is the same, but for hex numbers.

(useful point to note - you can convert from binary to hex by grouping your binary numbers into clumps of 4 and converting each clump)

Both of these are not part of the assembly language of the PIC, but are generally considered to be universal 'directives' to the program translating your code into machine code (the assembler) that you are using a binary number and not some multimillion value decimal number

I generally use binary to set bits on port pins and in registers (because you can see which bits are being set/cleared) and use hex (0x...)for addresses. Not all programmers agree, but this is my personal preference
 
Hello, keny ! When I reading your questions, Its feels me your in a mess. You better start from the very basics.
Read some books like "CRC Press Microcontroller Programming The Microchip PIC"

And also there are loads of info on Nigel's Page > WinPicProg Page

Please don't use 18F for now. Use very old 16F84A.
 
Last edited:
Yea i was definitely in the wrong place at the beginning of this thread, the predko books (evil genuis pic MCU experiments AND programming and customizing the Pic MCU) just really have no basis on progressive learning. Predkos approach reminds me of an old piano teacher I ditched. No explanation of why things are the way they are, he just put the theory out there (verbally) in ten seconds without establishing a foundation. I tried to read predko's foundation chapters and theres a lot of missing information and he rambles about stupid stuff like what he did when he was drunk in college. i dont have time for that so naturally i skip forward and well..... i digress...

Ive been schooling with this new book and it's what was missing in the other book. got usb. check. got config's check. next up I2C wish me luck...
 
Its freely available all over the web, Just do a simple Rapid Share search. :)

Congratulations, suggestions like that ensure that authors don't get paid and can't afford food.
 
Yea i was definitely in the wrong place at the beginning of this thread, the predko books (evil genuis pic MCU experiments AND programming and customizing the Pic MCU) just really have no basis on progressive learning. Predkos approach reminds me of an old piano teacher I ditched. No explanation of why things are the way they are, he just put the theory out there (verbally) in ten seconds without establishing a foundation. I tried to read predko's foundation chapters and theres a lot of missing information and he rambles about stupid stuff like what he did when he was drunk in college. i dont have time for that so naturally i skip forward and well..... i digress...

hi keny,
I see you have been studying writing with Predko... :p

The best place to learn about PICs is in Nigel's sig....
PIC programmer software, and PIC Tutorials at:
WinPicProg Page

and it is free. :D

else try Elmer 160 Home Page
:)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top