This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [t1] = ADC() | |
| %open com port | |
| pic =serial('COM18','BaudRate',19200,'DataBits',8,'Parity','none','StopBits',1,'FlowControl','none','Terminator','LF'); | |
| fopen(pic); | |
| pic.ReadAsyncMode = 'continuous'; | |
| display('Press w or s to change the timespan of the window'); | |
| display('Press a or z to change the lowerbound of vertical axis'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NET "clk50" TNM_NET = "clk50"; | |
| TIMESPEC "TS_clk50" = PERIOD "clk50" 50 MHz HIGH 50 %; | |
| NET "clk50" LOC = "B8"; | |
| NET "segments<7>" LOC = "L18"; # SEGMENTs | |
| NET "segments<6>" LOC = "F18"; | |
| NET "segments<5>" LOC = "D17"; | |
| NET "segments<4>" LOC = "D16"; | |
| NET "segments<3>" LOC = "G14"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library IEEE; | |
| use IEEE.STD_LOGIC_1164.ALL; | |
| use IEEE.STD_LOGIC_ARITH.ALL; | |
| use IEEE.STD_LOGIC_UNSIGNED.ALL; | |
| entity counter is | |
| Port ( clk : in STD_LOGIC; | |
| reset : in STD_LOGIC; | |
| hour : in std_logic; | |
| anode : out std_logic_vector(3 downto 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [t] = USBPIC() | |
| loadlibrary mpusbapi _mpusbapi.h alias library; | |
| vid_pid_norm = libpointer('int8Ptr',[uint8('vid_04d8&pid_000c') 0]) | |
| [PIC_connect] = calllib ('library','MPUSBGetDeviceCount', vid_pid_norm) | |
| out_pipe = libpointer ('int8Ptr',[uint8('\MCHP_EP1') 0]) | |
| [my_out_pipe] = calllib('library','MPUSBOpen',uint8(0), vid_pid_norm,out_pipe, uint8(0), uint8 (0)) | |
| in_pipe = libpointer ('int8Ptr',[uint8('\MCHP_EP1') 0]) | |
| [my_in_pipe] = calllib('library','MPUSBOpen',uint8(0), vid_pid_norm,in_pipe, uint8 (1), uint8 (0)) | |