Questions tagged [microchip]

Questions related to the microchip PIC family of microcontrollers. Where possible please specify the specific microcontroller.

Questions related to the microchip PIC family of microcontrollers. Where possible please specify the specific microcontroller.

696 questions
7
votes
1 answer

What causes a Java library to behave differently when called by JRuby?

I am new to the Java world, but am familiar with Ruby. I am trying to write a program that interacts with some third-party jar files. While the libraries seem to behave fine if called from Java, they behave incorrectly when I call them in JRuby. …
David Grayson
  • 84,103
  • 24
  • 152
  • 189
7
votes
5 answers

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

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…
Seidleroni
  • 1,044
  • 3
  • 15
  • 31
7
votes
1 answer

C: typedef union

didn't find anything in related questions. Most probably it's super noob, but I'll ask anyway/ I've got the following in my .h file: typedef union _API_Packet_0x90{ uint8_t packet[26]; struct _pack_struct { uint8_t start; …
dccharacter
  • 421
  • 1
  • 4
  • 14
6
votes
1 answer

Create big buffer on a pic18f with microchip c18 compiler

Using Microchip C18 compiler with a pic18f, I want to create a "big" buffer of 3000 bytes in the program data space. If i put this in the main() (on stack): char tab[127]; I have this error: Error [1300] stack frame too large If I put it in…
acemtp
  • 2,971
  • 6
  • 34
  • 43
6
votes
2 answers

Array doubles in size if a struct defines both its uint16_t words and uint8_t bytes

I have an array each of whose elements could be either uint16_t or a pair of uint8_t. Its elements are defined as a union of a uint16_t and a sub-array of 2 uint8_t. Unfortunately, the compiler (MicroChip XC16) allocates twice as much memory as it…
Davide Andrea
  • 1,357
  • 2
  • 15
  • 39
5
votes
3 answers

Casting to union field yields to conversion warning

I am using a Microchip microcontroller which defines the following union: __extension__ typedef struct tagT1CONBITS { union { struct { uint16_t :1; uint16_t TCS:1; uint16_t TSYNC:1; uint16_t :1; uint16_t TCKPS:2; …
5
votes
2 answers

How does TickGetDiv256() works?

Hi I wonder if anyone could give me an example how the TickGetDiv256(); function works. It came from Microchip in Tick.c Im trying to count for 2 houre's, if fullfilled an engine will be stopped. I could might use "threshold = tick +…
Christian
  • 1,548
  • 2
  • 15
  • 26
5
votes
2 answers

extracting secrets from an embedded chip

I am looking at an embedded system where secrets are stored in flash that is internal to the chip package, and there is no physical interface to get that information out - all access to this flash is policed by program code. All DMA attacks and JTAG…
Will
  • 73,905
  • 40
  • 169
  • 246
5
votes
6 answers

How to reset a PIC18 in C?

What is the best way to reset a PIC18 using C code with the HiTech Pic18 C compiler? Edit: I am currenlty using void reset() { #asm reset #endasm } but there must be a better way
Charles Faiga
  • 11,665
  • 25
  • 102
  • 139
4
votes
1 answer

How to call Microchip PIC USB DLL with Delphi 2009

Not a question, just a statement to help anyone else who might spend hours getting the Microchip PIC USB DLL to work properly with Unicode. It expects several strings, and although these are simple PAnsiChar, getting the right combination of DLL…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
4
votes
11 answers

Keeping time using timer interrupts an embedded microcontroller

This question is about programming small microcontrollers without an OS. In particular, I'm interested in PICs at the moment, but the question is general. I've seen several times the following pattern for keeping time: Timer interrupt code (say the…
Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412
4
votes
1 answer

Do I have to disable interrupts while in one?

Do I have to disable high interrupts while inside one, if I am using multiple interrupts on the Microchip C18? Consider the code below: #ifndef OTHER_INTERRUPT_H #pragma interrupt InterruptHook // interrupt fname void InterruptHook(void) { …
Christian
  • 1,548
  • 2
  • 15
  • 26
4
votes
4 answers

C++ running on PIC32 (MIPS32)

Unfortunately, my C app for PIC32 needs OO too much and I can't continue doing it in C. Do you know any MIPS32 C++ compiler for PIC32? Thanks
rnunes
  • 2,785
  • 7
  • 28
  • 56
4
votes
5 answers

FreeRTOS tasks are not context switching

I'm using FreeRTOS port for PIC32 microcontroller on the PIC32MX starter kit. Was just playing with tasks but the tasks aren't context switching. Here are my main config settings: #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5…
Laz
  • 6,036
  • 10
  • 41
  • 54
4
votes
2 answers

dsPIC33 updating PWM duty and frequency

I am trying to control a H-bridge converter using one PWM generator for each diagonal (PWM1 and PWM4 in my case). I want to be able to control both frequency and duty cycle. To do so, I generate a trigger interrupt at the beginning of PWM4 period,…
1
2
3
46 47