pic

Multithreading using C on PIC18

How does one create threads that run in parallel while programming PIC18, since there is no OS? ...

Which embedded (microcontroller) platform to move to

Hi all. I have been programming with 8bit PICs for quite some time but now need to move to something more powerful. I would like a family of chips that: I can get a good (free) IDE for Solderable packages, QFN or similar (arm9 out) Scales well -- some of my projects will require a small chip for PWM / switches etc, but I'd ultimately...

I'd like to move on to µC programming, but I have absolutely no idea where to start from.

Hello, I've been thinking quite some time about 'moving on' to MCU programming, but the problem is I've never worked with any microcontrollers or similar. As I've been told, AVR and PIC are the most common microcontrollers among hobbyists, and apparently most people suggest AVR for newcomers like me, due to its 'C-friendly architecture'...

One Wire Problem

Hi all! I need your qualified help! I'm programing in C++, using a PIC 18F87J50 and trying to connect DS18B20 at my H0 Port! I think my underlying programing is correct so.... the problem I have (think I have), is when performing a ROM Command, I'm searching for the 64-bit ROM CODE. The first byte should tell me what family the compon...

1wire problem in detail

I have defined these functions below, and when I ask Device_ID function for example of the family code, I only get FF (should be 28), acctually I get both the family code, 48-bit serial, and the crc 8 bit to be all "ones". It seems like the detect slave device function works as it should.... If i connect the slave he say's I am here, and...

Delay in MCC18, 48Mhz, 18F87J50

How should i write a delay macro for an PIC 18f87J50 with a 48MHz crystal and compiler of MCC18. The delay should be in us. So I for example can write: Delay_us(201) and really get 201us delay. What I have now is: #define Delay_us(n) (Delay10TCYx(((n) * (uint16_t) 12 + 9) / 10)) And it does'nt seems right at my oscilloscope! :/ Kind...

Sending data over tcpip using Microchip's PIC18F

All of the examples in the TCPIP Demo App are built using a custom program that designs a webpage that triggers callbacks when the webpage is changed. Is it possible to get a value from a sensor every X seconds and send the data out over an HTTP POST? ...

Free PIC C compiler

I am looking for a free, and possibly open source C compiler for PIC. I might go without C, but I would like to get both options. There are various compilers out there, but since I have never done PIC development before, I am looking for user experience and advice. I am targetting the PIC16F88x family ...

PIC C - USB_CDC_GETC() and retrieving strings.

Hi all, I'm programming a PIC18F4455 Microcontroller using PIC C. I'm using the USB_CDC.h header file. I have a program on the computer sending a string such as "W250025". However, when I use usb_cdc_getc() to get the first char, it freezes. Sometimes the program sends only 'T', so I really want to just get the first character. Why ...

PIC C - Sending 200 values over USB, but it only sends 25 or so of them...

I have a PIC18F4455 microcontroller which I am trying to use to send 200 values over USB. Basically I am using a for loop and a printf statement to print the values to the usb output stream. However, when the code executes I see in my serial port monitor that it is only sending the first 25 or so values, then stopping. My PIC C code i...

Difference between PORT and LATCH on PIC 18F

I already read the datasheet and google but I still don't understand something. In my case, I set PIN RC6 of a PIC18F26K20 in INPUT mode: TRISCbits.TRISC6 = 1; Then I read the value with PORT and LATCH and I have different value! v1 = LATCbits.LATC6; v2 = PORTCbits.RC6; v1 gives me 0 where v2 gives 1. Is it normal? In ...

Writing to EEPROM on PIC

Are there any PIC microcontroller programmers here? I'm learning some PIC microcontroller programming using a pickit2 and the 16F690 chip that came with it. I'm working through trying out the various facilities at the moment. I can sucessfully read a byte from the EEPROM in code if I set the EEPROM vaklue in MPLAB but I don't seem to be...

USB HID protocol question

I'm implementing USB on a PIC 18F2550 using a generic HID interface. I've set up the HID profile configuation to have a single 64 byte message for both inputs and outputs. Now it's basically working. The device registers OK with windows. I can find it in my program on the PC and can send and receive data to it. The problem is this thoug...

PIC question..~

I am currently undertaking software engineering program in one of the local universities at my country. And i am interesting in software and hardware. So i decided to learn it by myself. One of my seniors told me to start with PIC 16 or 18 first. Anyone of here has any links for the related website? And where can i get a device to progra...

Is there any tool available to convert ASM to C for PIC 16F877A

Hi, I want to convert ASM file to C program. is there any tools available for this. My intention is to convert assembly program of PIC 16F877A program to C program... ...

8051 microcontroller kit recommendation?

I'm a first year Computer Science student looking to get started with development for micro-controllers. I'd like to use the 8051, as it's common as dirt, and is used frequently in the real world. During my junior or senior year, I'll be taking a PIC micro-controller based embedded design class, so I'd rather not do PIC now; otherwise,...

PIC disassembler Needed

I want to disassemble a hex file of PIC16F877A. Is there any good disassembler ? After disassembly is it possible to compile again ? What are the things I have to take care of ? ...

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 global, I have this error: Error - section '.udata_main.o' can not fit the section. Sectio...

Communicating with the Pic 16F913

Here is my issue, it appears that all the communication lines for the PIC 16F913 reside on the same set of pins, this is convenient in that I don't have to sacrifice GPIO pins just to do comms, however the problem I'm having now is if I'm using the SPI on the chip, how can I send information to the RS232? The reason this issue came up,...

Best practice for function to handle 1-256 bytes

I have some functions that are designed to handle 1-256 bytes, running on an embedded C platform where passing a byte is much faster and more compact than passing an int (one instruction versus three), what is the preferred way of coding it: Accept an int, early-exit if zero, and otherwise copy the LSB of the count value to an unsigned...