pic

Print a message through EUSART PIC18F45K80

不问归期 提交于 2019-12-02 19:31:24
问题 I am trying to send a message to serial to Docklight but I get a null the whole time. I am using a PIC18F45K80 with XC8 MPLAB X. All seems correct in my code but I guess I am wrong. How can I fix it? #include <xc.h> #include "PIC.h" // INITIAL PIN SETUP void PIN_MANAGER_Initialize(void) { /** LATx registers */ LATE = 0x00; LATD = 0x00; LATA = 0x00; LATB = 0x00; LATC = 0x00; /** TRISx registers */ TRISE = 0x07; TRISA = 0x08; TRISB = 0x01; TRISC = 0b00010000; TRISD = 0xEF; PORTC = 0b00010010 ;

pronounce a color based on the bits values with the pic 18f4550

陌路散爱 提交于 2019-12-02 13:45:17
update 2 I want to make a program that can play sound (that can say red, green and blue) on my pic 18f4550 there is a speaker connected to the picdem, that part works fine, I wrote the following program with microchip version 6.83 with the C compiler. I need to retrieve the bits value of a .wav file, when I say red (this has a bit pattern). My right question, how can a get the bit value of my .wav file. void main (void) { TRISD = 0x00; // PORTD als uitgang TRISB = 0b00110000; // RB4 en RB5 als ingang TRISA = 0x00; // RA output RCONbits.IPEN = 0; // interrupts INTCONbits.GIE = 1; INTCONbits

9.7. Relocation and Position Independent Code (PIC)

£可爱£侵袭症+ 提交于 2019-12-02 10:51:54
9.7. Relocation and Position Independent Code (PIC) In this section we’ll investigate the difference between position independent code (known as “PIC” from here on) and non-position-independent code and how both affect relocation. 在本节中,我们将研究位置无关代码(此处称为“PIC”)与位置无关代码之间的区别以及两者如何影响重定位。 9.7.1. PIC vs. non-PIC Much of the complexity in the ELF standard is due to the need to load shared libraries at different locations in a process’ address space. Objects built to be position-independent are specifically meant to be loaded anywhere in the address space. As discussed earlier, the code in ELF files

Print a message through EUSART PIC18F45K80

本秂侑毒 提交于 2019-12-02 10:22:33
I am trying to send a message to serial to Docklight but I get a null the whole time. I am using a PIC18F45K80 with XC8 MPLAB X. All seems correct in my code but I guess I am wrong. How can I fix it? #include <xc.h> #include "PIC.h" // INITIAL PIN SETUP void PIN_MANAGER_Initialize(void) { /** LATx registers */ LATE = 0x00; LATD = 0x00; LATA = 0x00; LATB = 0x00; LATC = 0x00; /** TRISx registers */ TRISE = 0x07; TRISA = 0x08; TRISB = 0x01; TRISC = 0b00010000; TRISD = 0xEF; PORTC = 0b00010010 ; /** ANSELx registers */ ANCON0 = 0x00; ANCON1 = 0x00; /** WPUx registers */ WPUB = 0x00; INTCON2bits

Linker file unselected

百般思念 提交于 2019-12-02 09:21:44
I am dealing with a problem in my application with the linker file. What's happening is in the explorer tab it seems the linker file it's not "selected" I have to refer that I also have a bootloader. I'm getting an error of "(944) data conflict at address 1FC02FF8h" and I think it's related with that. Can anyone help me on that? Many Thanks. Right click your linker files folder and make sure that the file is not excluded in your current config. Edit: Right Click "Linker Files"->Properties 来源: https://stackoverflow.com/questions/32049728/linker-file-unselected

js原生实现轮播图

半城伤御伤魂 提交于 2019-12-02 06:24:11
效果图: 轮播样式及左边二级导航栏样式和HTML代码 * { padding : 0 ; margin : 0 ; list-style : none ; border : 0 ; } body { font-family : "微软雅黑" ; color : #14191e ; } .all { width : 800px ; height : 500px ; float : left ; position : relative ; } .screen { width : 800px ; height : 500px ; overflow : hidden ; position : relative ; } .screen li { width : 800px ; height : 500px ; overflow : hidden ; float : left ; } .screen ul { position : absolute ; left : 0 ; top : 0px ; width : 4800px ; } .all ol { position : absolute ; right : 10px ; bottom : 10px ; line-height : 20px ; text-align : center ; } .all ol li { float :

第五章-Linux实操篇

浪子不回头ぞ 提交于 2019-12-02 06:19:16
title: 第五章 Linux实操篇 categories: Linux tags: linux typora-root-url: … abbrlink: 93414991 date: 2019-08-15 15:27:58 第五章 Linux实操篇 远程登录Linux系统 5.1 为什么要远程登录服务器 5.2 xhell5(windows)远程登录软件 需要Linux开启sshd服务 22端口 5.3 xftp 远程文件操纵 第六章 Linux实操篇 vi和vim编辑器 6.1 vi 和vim介绍 vi是系统自带的文本编辑器 vim是vi的增强版 6.2 三种模式 6.2.1 正常模式 正常模式下,我们可以使用快捷键 6.2.2 插入模式 在该模式下,程序员可以输入内容 6.2.3 命令行模式 完成读取、存盘、替换、显示行号等动作 6.3 快速入门 yy 复制 dd 删除 u撤销 set nu 设置行号 set nonu 取消行号 shift+g 定位 eg: 5 shift+g 定位到第5行 第七章 Linux实操篇 开机、重启、用户登录注销 7.1 关机和重启指令 shutdown shutdown - h now shutdown -h 1 表示1分钟后关机 shutdown -r now 立即重启 halt 直接使用,效果等价于关机 reboot 重启系统 sync

Assembly of PIC

跟風遠走 提交于 2019-12-02 03:55:55
问题 The address of str is stored the stack(can use pop to fetch it, and it's position independent): .text str: .string "test\n" But now the address of str is not in the stack(can't use pop to fetch it, but str(%rip) (RIP relative addressing) is PIC): .text str: .skip 64 This is what I found from my previous question, but I don't understand how assembler decides address of str should be in the stack or not? WHen should I use RIP-relative addressing ,or use pop to make it PIC? UPDATE This is

How to rotate the bits in a word

最后都变了- 提交于 2019-12-02 03:33:18
问题 I'm using a dsPIC33F and GCC. I want to rotate the bits in a word once left or right, like this: MSB LSB input: 0101 1101 0101 1101 right: 1010 1110 1010 1110 left : 1011 1010 1011 1010 (In case it's not clear, the LSB moves into the MSB's position for the right rotate and vice versa.) My processor already has a rotate right (rrnc, rrc) and rotate left instruction (rlnc, rlc), so I'm hoping the compiler will optimise this in. If not, I might have to use inline assembly. 回答1: You may write

Python: 截屏

扶醉桌前 提交于 2019-12-01 23:27:05
最近项目中想实现截屏功能,使用的笔记本是高清屏,实际屏幕设置成了150%,所以在截屏的时候遇到个各种问题。 最开始使用PIL ImageGrab来截取屏幕,如果本来是100%的设置没有问题,能截取到全屏,但是150%或者其他设置的就会有问题,只能截取到屏幕的左上部分,无法截取到全屏。 from PIL import ImageGrab pic = ImageGrab.grab() # print(pic.size) pic.save(r'C:\Users\test\Desktop\Automation\python\pic.jpg') 但是这个问题很奇怪,也有的机器150%设置,但是执行后没有问题。 遇到这个问题后看到网上有个解决方法:在注册表中Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers添加python.exe和pythonw.exe路径信息进去,再次执行程序就能截取到全屏,用python代码添加注册表的话,要重新再次运行程序才能截取到全屏: from PIL import ImageGrab import winreg reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER)