microchip

Why does this state machine not maintain its state?

不问归期 提交于 2019-12-11 03:54:12
问题 Hey there StackOverflow! In the following code I have a simple state machine that changes the operation of some external lighting device (as the comments imply). The state is changed via the pressing of the button connected to GP1. The circuit connected to GP1 is a comparator debouncing circuit that compares VDD to 0.6VDD (I've also tried an RC/diode/schmitt trigger circuit), which then forces the signal LO. On a scope, we see a clean square wave when the button is actuated rapidly. The

Receiving “undefined symbols” error with XC8 concerning plib I2C functions

六眼飞鱼酱① 提交于 2019-12-10 18:26:06
问题 Hey there StackOverflow! My question concerns errors being reporting within the program pasted (far) below. The target device is the PIC12LF1552 , it has one serial peripheral on it that I assumed could be used in conjunction with the library supplied with Microchip's XC8 compiler. Some sources on the internet have said that only higher end devices in the PIC18 line would support the library functions, other sources have said the library functions work just fine. So I decided that I didn't

Gather variables from multiple files into a single contiguous block of memory at compile time

时间秒杀一切 提交于 2019-12-10 15:13:26
问题 I'd like to define (and initialize) a number of instances of a struct across a number of *.c files, but I want them to gather at compile time into a single contiguous array. I've been looking into using a custom section and using the section's start and end address as the start and end of the array of structs, but I haven't quite figured out the details yet, and I'd rather not write a custom linker script if I can get away with it. Here's a summary of my first hack which didn't quite work: //

XC8 error 224: illegal # directive (first line)

China☆狼群 提交于 2019-12-07 15:18:46
问题 I'm using Microchip's XC8 compiler. They want me to #include <xc.h> instead of including a chip-specific header. However, when I add this code on the first line of my code, I'm getting the error: Error [224] C:\...\main.c; 1.4 illegal "#" directive When I place a line feed before the directive, I don't get the error. Why is this? My full code: #include <xc.h> #pragma config OSC =INTIO67, WDT = OFF, LVP = OFF, PBADEN = OFF void main() { while (1); } With the line feed, the code looks just the

XC8 error 224: illegal # directive (first line)

女生的网名这么多〃 提交于 2019-12-05 19:41:51
I'm using Microchip's XC8 compiler. They want me to #include <xc.h> instead of including a chip-specific header. However, when I add this code on the first line of my code, I'm getting the error: Error [224] C:\...\main.c; 1.4 illegal "#" directive When I place a line feed before the directive, I don't get the error. Why is this? My full code: #include <xc.h> #pragma config OSC =INTIO67, WDT = OFF, LVP = OFF, PBADEN = OFF void main() { while (1); } With the line feed, the code looks just the same, but with a blank line on top. One thing that may cause this is corruption or other characters at

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

好久不见. 提交于 2019-12-04 07:23:00
问题 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

cdc_acm : failed to set dtr/rts - can not communicate with usb cdc device

落花浮王杯 提交于 2019-12-03 14:50:10
I was trying to enumerate usb cdc device using pic24fj128gb206. Device seems to be enumerated properly. But when I connect my device to Linux PC, I am getting the below warning message from kernel. cdc_acm 1-8.1.6.7:1.0: failed to set dtr/rts And this message will repeat when I try to connect using screen. screen /dev/ttyACM9 115200 And I am not able to communicate with my device from PC [ Ubuntu, 14.04 ] When analysing the data using wireshark, it looks like USB communication is fine until, host issues URB_CONTROL_out and the device responds with URB status as Broken Pipe (-EPIPE ) (-32) Can

Whats the best resource to learn Assembly language for PIC microcontroller's [closed]

孤者浪人 提交于 2019-12-03 07:21:49
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. I'm going to start working on a project where I need to have a decent understanding of Assembly language for the PIC microcontroller's. I'm intimately familiar with C/C++, so I know how to code for the most part, and I have done many projects for the PIC

What is the best c compiler for the Pic18 micro [closed]

只谈情不闲聊 提交于 2019-12-03 02:54:07
Closed . This question is opinion-based. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . We are starting a new project based a microchip PIC18F252. What is the best 'c' compiler to use? tech PICC has always been reliable for me and it has had many years of development. Veynom Microchip C18 compiler : really the best and easiest to use. Perfect for professional use. HI-TECH : Used when Microchip does not work (it was for a PIC16). CCS SourceBoost PS: I myself worked on

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