|
******************************************
Welcome To CrazyEngineers (CE) – an online community of engineers from all over the world! With the younger CEan at 84 and the youngest at 16, CE boasts of professional engineers, students, professors, entrepreneurs, CEOs, geeks & nerds. We exchange innovative ideas, share knowledge, help each other and expand our worldwide network of engineers! You need not have a formal degree in engineering to be a part of CrazyEngineers! Need we say more? Join CE! | CE Innovator Contest! | Forgot password? | Contact Us |
![]() |
| Sponsored links | |
|
|
|
|
Moderator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
I'm a Crazy Communications Engineer
Join Date: 12th July 2007 Location: IIUM, Malaysia
Posts: 1,415
|
Ah, heres the thing. I think you can't really send serial data directly into the input pins of the PIC easily (assuming you are talking about the Microchip variants). You'd need to use the Rx/Tx (recieve and transmission) pins to do all serial data communications.
In brief, microcontrollers are pretty much miniturized microprocessors, thus some of the architecture is similar. You have registers, interrupts, flags, and memory locations, etc. Whatever data is sent to the microcontroller, they will be stored in memory locations that have their own addresses. Each address location can store 8 bit of data (if you talking about an 8 bit microC). Thus, when you send the binary byte of 01011001, the microC will store it at a particular address in which the address register is pointing at. Whenever it wants to recall the byte, it'll just find the address, just like microprocessors. So how do you recall the data? This depends on how you program the PIC. Using assembly language, you'd need to directly enter the address in which the data is stored into the address register, copy the data into a general purpose register, etc. However, if you use C programming, you only need to initialize a variable with a name of your choice, store the data, and then simply recall the variable (whether you want to print the data, add something, etc). A note about polling it. PIC's (and perhaps other microcontrollers) have very limited memory to store instructions. Using the polling method to store serial data will bloat the code it for sure. Which ever way you program it, the final assembly code will contain lots of loops, delays, instructions to add bits, conditions to check the start and end bits, etc. Use the dedicated Rx/Tx pins for those stuff
__________________
Keep it simple. Keep it real. | New to CE? Click here! | Join our CE Bot project! | Problems? Questions? PM or mail me at ash{at]crazyengineers{dot]com |
|
|
|
|
|
Moderator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
I'm a Crazy Communications Engineer
Join Date: 12th July 2007 Location: IIUM, Malaysia
Posts: 1,415
|
How are you communicating to the microcontroller in the computer? Hyperterminal? Have you loaded the code into the microcontroller?
__________________
Keep it simple. Keep it real. | New to CE? Click here! | Join our CE Bot project! | Problems? Questions? PM or mail me at ash{at]crazyengineers{dot]com |
|
|
|
|
| Sponsored links | |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| Contact Us - Home - Impressum | Impressum - Archive |