MATLAB To PIC Serial Interface PDF
MATLAB To PIC Serial Interface PDF
Table of Contents
intro: MATLAB to PIC serial interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
http://www.instructables.com/id/MATLAB-to-PIC-serial-interface/
http://www.instructables.com/id/MATLAB-to-PIC-serial-interface/
'_
''
' '------LED---\ 470 ohm
'PIC' >------/\/\/\------GND
' '------LED---/
'---'
'
'This code also assumes that you have the TX line of the DB-9 serial port connected to pin 0 of port C (PORTC.0)
Include "bs2defs.bas" 'has some useful stuff in it
'DEFINE OSC 4 'Oscillator speed in MHz, this isn't needed I guess
SerI var PORTC.0 'make an easy name to refer to the serial pin
TRISD = %00000000 'set PortD as an output port
PortD = %00000000 'set LED port to all zeros
GetGhost:
Serin2 SerI, 84, (DEC3 B0) 'get a three digit number from serial pin and put it into B0 variabl
PortD = B0 'set the lines of PortD according to this three digit number
GOTO GetGhost
'===========================================================================
'===========================================================================
File Downloads
Lee_PIC_To_MATLAB_serial_communication.txt (3 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Lee_PIC_To_MATLAB_serial_communication.txt']
Related Instructables
PICBasic serial
interrupts with
PIC16F877 by
leevonk
Eagle-ize
Leevonk's PIC
Intro to PIC
Microcontrollers protoboard by
westfw
by leevonk
Put your R/C car LCS-1M - A Fullunder computer Featured, Lowcontrol by prank Cost Hobby
Oscilloscope by
womai
http://www.instructables.com/id/MATLAB-to-PIC-serial-interface/
PIC
development/testing
board by leevonk RF Serial Data
Link {through
USB} by barmak
How to choose
a
MicroController
by westfw
Advertisements
Customized Instructable T-shirts
Comments
13 comments Add Comment
crapper says:
duyngdang says:
morteza.jalalat says:
duyngdang says:
leevonk says:
uhm, how bout using my code that's staring you right in the face on the next page:
SerPIC = serial('COM3'); %<--change this appropriately
set(SerPIC,'BaudRate', 9600, 'DataBits', 8, 'Parity', 'none','StopBits', 1, 'FlowControl', 'none');
!!!!!!!!
note the very important SerPIC = serial('COM3');
!!!!!!!!
BlessedtoknowHim says:
http://www.instructables.com/id/MATLAB-to-PIC-serial-interface/
behrouz2007 says:
duyngdang says:
jnk101 says:
gr8 begining
chk out :
http://www.dspaceinc.com/ww/en/inc/home/products/systems/controld.cfm
have u come across diy / open source for this stuff
really keen on this stuff
finly says:
ppsh04 says:
Thank you for the experience you have shared here. This post is really effective for my program.
:D Hope you can contribute more. Good Luck!
ferasmetib says:
leevonk says:
http://www.instructables.com/id/MATLAB-to-PIC-serial-interface/