Pic lcd

Thread Starter

arikiev

Joined Sep 18, 2010
4
Hi,

Disclaimer:
you are going to read a foolish, <snip> beginner, novice, ordinary question.

The question starts from here:

I've met a way of PIC MCU pin assignment which is new to me:
Rich (BB code):
sbit CS=P2^5;        //Chip select
The style I knew from before is like:
Rich (BB code):
void main()
{
TRISB = 0; // Configure PORTB as output
PORTB = 0xAA; // Turn on odd numbered port pins
}
Could anyone please explain how the initial method works?

Also, in the codes I see:
Rich (BB code):
#include "reg52.h"
Does anyone knows about this file or could point me to an article about its usage? I guess that it is a way of defining/assigning ports of PIC, but I need something more than "guess" to work with :D
 
Last edited by a moderator:

debjit625

Joined Apr 17, 2010
790
You have mixed codes of two different chips.#include "reg52.h" is a header file which define all the SFR of 8052 its a mcu like PIC.Many company provide 8052 chips and one of them is Atmel search their AT range.And yes another thing the PIC C compiler is not going to compile code for 8052 you need something other like uVision IDE with C51 compiler.

Good luck
 
Top