336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Types of Serial Communication used over the years.

시리얼 통신 타입들

●UART

●E&C

●SBI

●SPI

●LIN

●Keyword 81, 82 and 2000

●Class 2

●CAN

 

 

GMLAN : GM대우 차량에서 사용되는 LAN(=근거리통신)이다.

BCM(=Body Control Module = 그림참고)

고속 시리얼 데이터는 두개의 와이어를 통해 전송된다. (☆ Noise가 줄어든다.)

그림상에서 6번 14번 포트가 이에 해당된다.

 

 

.

.

.

 

차량 통신의 다음 세대는 섬유광학이 될것이다. (= 광섬유)

 

SAAB에서 가벼운무게화 노이즈와 데이터 손실이 거의 없다는 이유로

Fabric-Optics(=섬유광학)을 이용하고 있다.

 

광섬유가 사용되는 곳은 주로 Master_Bus 라고 불리는 곳이다.

위 그림에서 모든 모듈이 만나게되는 두꺼운선으로 표시된 곳이다.

Posted by ElectricShock
:

PIC

2012. 12. 22. 14:09
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

http://www.codeproject.com/Articles/29528/Programming-the-PIC-Microcontroller-in-C-using-PIC{

 

 

Programming the PIC Microcontroller in C using PIC C Lite

PIC_C_Lite_Code.zip

Introduction

Programming microcontrollers using assembly language is very frustrating and cumbersome, not to mention archaic.

실망스런 & 성가신                          원시적인건 말할것도 없고

As time goes by, developers have started building compilers for high level languages, targeted specifically for microcontrollers.

I use PICs personally, and there is quite a lot of resources for them.

Even good basic compilers like MBasic exist,

but I hate BASIC,

so I won't even talk about it!

I have tried building applications for the PIC16F84,

 

a very popular microcontroller,

with various compilers like CC5X, SDCC (this is Open Source), and PIC C from HiTech software.

I have not yet used mikroC from Microchip,

because I do not use higher PICs.

Each of these has its own strong points and weak ones,

but by far, the best compiler I would recommend is PIC C.

하지만 훨씬    최고의 컴파일러                            는 PIC C 이다.

There is a free Lite version from HiTech Software,

UniversalToolsuite-1.37.exe

and as expected,

I would not expect anything less from a company

that has its aim at specifically developing C compilers for PIC microcontrollers.

Background

As usual,

for any beginner of any type of coding,

초보자들에게

there must always be that first "hello world" application!

헬로월드가 첫 어플리케이션임에 틀림없다.

In microcontroller programming,

this is most definitely flashing an LED on and off. We shall do this now.

마이크로컨트롤러 프로그램에선

LED ON & OFF이다.

I am using the HI-TIDE Integrated Development Environment with PIC C Pro (45 day trial).

☆ IDE가 붙으면 통합된 개발환경이라는 뜻 (=프로그램을 복합적으로 설치 & 이용가능)

You can use PIC C Lite as well (it will produce a larger hex file because it does not have omniscient code generation).

전지전능 코드 생성기    (=옴니션트)

What's more?

PIC C Lite easily integrates into Microchips MPLAB...so there you go...you have two free products.

PIC C Lite는 쉽게 통합한다. into MPLAB에.

 

SDCC has an IDE called DevMic (I think it's written in Delphi just like DevC++; they are so similar), and both are Open Source. But, let's reserve SDCC for some other time...I wouldn't say it's better for a beginner.

초보자에게 권장하지않는게 낫겠다.

So, let's get some Zzzzt zzzt as the old CodeProject saying goes!!

The <htc.h> and <pic.h> contain standard definitions,

and

are never to be left out of any source file you are working with.

Since we want the LED to delay a bit,

we shall use a function DelayMs(int); this function only takes values up to 255.

↑이 함수는 취한다 갑을 up to 255까지.

This number indicates the number of milliseconds

for which you want the LED to be on or off.

이 숫자는 가리킨다. the 횟수 of 밀리초

for 얼마나 네가 원하는지 LED를 to be ON 혹은 OFF가 되게끔

Furthermore,

you will have to declare which port, or more specifically,

which pins are outputs

and

which ones are inputs.

더 나아가,

넌 선언해야만 할것이다. which 포트를, 좀더 구체적으로

which 핀들이 출력이될지

&

which one들이 입력이될지.

PortB has 8 ports from RB0-RB7,

and

is bidirectional (any pin can be an input or an output).

PortA has pins from RA0-RA5,

and

is also bidirectional.

 

However,

only RB4 to RB7 can be configured as interrupts. We shall see later what an interrupt is.

나중에보자 무엇인지 인터럽트 란.

Your code should look like this in the editor:

 

Get the formed HEX file and load it into the microcontroller (I am assuming you know how to do this).

Please remember that we are using a PIC16F84.

☆위 코드와 PIC16F84는 한쌍이다.

If you are using another type, then you will have to specify this detail when making your project.

HI TIDE even enables you to adapt your source code

for any type of PIC anytime,

even as you work with your project.

HI TIDE(IDE = 통합 개발활경)는 심지어 가능케한다. 널 to 적응하도록 네 소스코드를

for 어느 타입of PIC에 언제든,

심지어 as 네가 작업하면서 with 네 프로젝트로.

The PIC has a maximum source current of 25mA (I have measured currents of up to 26.3mA some times),

and

this is enough to drive LEDs directly.

이 전류는 충분하다. to 가동시키는데 LED들을 곧바로.

So, if you connect your LED to the RB0 pin and ground, you should see it flashing at a quarter of a second.

만약 네가 연결하면 네 LED를 to the RB0 핀에 & 접지에, 넌 봐야만한다. 그게 번쩍이는지 at a 1/4 초로.

Please remember that an LED is a p-n junction,

so you must have your connection right (in short, if one orientation doesn't work, the second should!!!).

 

Interfering with normal operation

Always, in microprocessors and microcontrollers,

we want the device

to control multiple things,

and react differently according to different situations.

우리는 원한다. 디바이스를

to 제어하기위한 다중적인 것들을,

and 반작용하기를 다르게 according to 다른 상황들에 따라서.

In other words,

let there be sequence1 in a normal operation; when such and such a thing happens, activate sequence2.

Normally,

this would be called an “interrupt sequence”,

but to avoid criticism

from more experienced programmers

(interrupt sequences must reside in their own code space

within the program,

and directly cause the execution of the main routine to change),

let us just call it “interfering with normal operation”!

to 비평을 피하기위해

from 더많이 경험함 프로그래머들로부터의

(인터럽 시퀀스들은 must 거주해야만한다. in 그들소유 코드공간안에

within the 프로그램내부의,

and 곧바로 유발한다. the 실행을 of the 메인 루틴의 to 바꾸기위해),

let us 그저 호출하자 그걸 "방해하는 with 일반 연산자와함께"!

There are two ways

to do this in C.

One is to use if statements,

and another is to use a while statement.

I hate while loops, so we shall stick to "if".

We are going to modify our code a little,

and even add an extra function so that we can specify our "delay" in decimals of seconds

instead of being limited to milliseconds (moreover 255!).

So,

let us create another project in HITIDE or MPLAB,

and

insert this code.

It is called Interrupt.c in my uploaded source code.

 

 

I recommend that

you learn how to convert from hexadecimal to binary and vice versa.

난 권한다. that을

네가 배우길 how to 바꾸는 법을 from Hex를 → 2진수로 & 그 반대로.

You need it

if you are going to work with PICs in C. What we have done now is:

만약 네가 작업할꺼라면 with PIC들과 in C언어로. What 네가 이미 마쳐야하는것은

  • We have configured pins RB4 to RB7

                  to accept inputs,

and thus interrupts,

since they are the only pins that can do that, and

우리는 이미 구성했다. 핀들을 RB4 to RB7을

to 받아들이기위해 입력들을

  • we have RB7 as our interrupt pin.
  • 우린 갖고있다. RB7을 as 인터럽트 핀으로써.
  • In normal operations, RB7=1.
  • Our interrupt action shall be to ground RB7 and force it to zeroes (the hardware always prevails over the software!).

So,

build the project, and program the PIC.

It should be going on for about 2 (1.8 to be precise) seconds,

then

off for about a second.

Now, connect a wire to RB7 and pin it to the ground.

The sequence will change,

and the LED will be flashing faster, being on for 0.7 seconds, and off for only a tenth of a second.

We have successfully programmed the interrupt!

What's more?

Want to instead flash a big bulb or a DC motor? I will tell you how if you let me know! We just have to amplify the current and use a transistor!

Any questions and troubleshooting are welcome.

I will write more articles on how to build complex algorithms for things like decorative lights, simultaneous LED flashing at different time intervals, and much more!

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

About the Author

I have deserted general software development and chosen to enter microprocessors and push around 1s and 0s

Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


졸업작품 의뢰는 (▶LINK)를 눌러주세요


Naver

[vision camera 졸작] 



(다이어리에 필기하고 스캔뜬다음 여기에 붙여넣기 할것!!!)

이번 시간에는 Tracking에 도전해보자

Tracking에는 3가지 종류가 있다.

●Camera Tracking

●Object Tracking

●Motion Tracking

Someone made a hole in the street with a graphic effect in Blender.

그래픽 효과를 이용하여 도로에 의문의 구멍을 뚫어버렸다.

 

We can overlap 3D virtual objects on the thing she is now holding.

우리는 여자가 들고있는 것에 3D 가상객체를 오버랩 할 수 있다.

 

The YouTube Video above recommends using footage in TGA format.

I'm not sure if it is possible to use footage in mp4 format.

유튜브에서는 TGA포멧의 동영상 사용을 권장한다.

 

 

Before you start,

do not forget to add an object.

 

Name it by whatever you are tracking.

 

 

(1:58...)

Blender basically lets us divide the video between 3 different color channels

and of course his face is being built by mostly red.

So, if I turn off red.......that is not good.

contrast 대조

 

현재는 RGB가 "ON" 상태이다.

동영상의 전체적 색감이 Blue라면 B를 "ON" 상태로 두고

나머지 R과 G를 "OFF" 상대로 두면 된다.

 

>>

How to mark contrast on an object.

표시하는법 대조되는부분을 on an 객체상의

아까 위에서 본 그림 처럼 객체를 입일 부분은 대조되는 색깔을 띄고 있어야한다.

 

위의 원본 footage에서  +

 

Rad Circle means point let me move the area along with center.

Blue Circle means point let me extend the area along with center.

 

If you made a mistake

in setting area,

just hit "Delete" or Ctrl+Z to undo.

 

 

Let's Back to the YouTube.

 

The mark is lot more contrast on his face.

and makes this easier for you  to see more clearly.

I'm going to turn off the color channels  for my mark here.

  현재 붉은색으로 표시된 G, B가 OFF 상태이다. (좀더 선명하게 표시됬다.)

and start tracking ~!!

 

Alt+A to look the view.

After this tracking,

I am gonna be speeding everything up. (2:24 / 9:32 on the YouTube)

So,

I'm not gonna make you sit here and watch this. (빨리끝내겠다는말)

.

.

.

(3:10/9:32)

I'm just gonna explain real quick

why you need parallax on your nose and trackers on the sides.

(parallax : /패럴랙스/ = 시차)

 

 

(3:19 / 9:32) ▽ 왜 시차가 필요한지 이유설명

Cause there is already parallax with the markers on my nose

compared with the ones on my actual face.

 

Ok, I meet the footage here. (여기 영상을 충족시켰다.)

(= Here's the footage.)

 

   >> 

 

 

 

Posted by ElectricShock
:

BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
Programming(=프로그래밍) (3)
MiDi (2)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백