Questions tagged [pic18]

The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.

230 questions
2
votes
1 answer

Put the data from a .wav file into the flash memory of pic18F4550

I'm new at hardware programming: I work with the pic18F4550 with the C compiler from microchip version 8.63. My question is: has someone example code to write a .wav file (binary data) to the flash memory of the pic18F4550?
projecten1
  • 67
  • 9
2
votes
2 answers

PIC18F4550 customize USB VID and PID

I'm new to PIC programming, and I'm ready to make a USB program so that I can send it motor control commands from my program on a (Windows XP) PC. How do I set the VID and PID for PIC18F4550? I read over the datasheet, but it doesn't seem to say…
lmat - Reinstate Monica
  • 7,289
  • 6
  • 48
  • 62
2
votes
1 answer

PIC18f46k42 UART not receiving

The TL;DR first: UART1 receiver isn't receiving; please tell me what I'm doing wrong. More detailed version: I'm currently working on a project that uses UART to send status reports between two PIC18f46k42 chips. Previous tests on a prototype board…
Chris
  • 31
  • 4
2
votes
1 answer

Simple Interrupt program traps/freeze cpu(USART/PIC18F/MICROCHIP/XC8)

I am using the following: pic18f4550, xc8 compiler, mplab x ide v3.20, a transmitter and receiver module (tested with a main program without any interruptions and works). LED's connected to RD0,RD1 and RD2 (1 = light up) Buttons…
Steve Quek
  • 21
  • 4
2
votes
2 answers

SPI master to PIC18F4550 slave synchronization (C18) using NETMF

A .NET Micro Framework device (ChipworkX in this case) sends a byte through the SPI interface to a PIC18F. Having PIE1bits.SSPIE enabled, the following code is executed on interrrupt: void high_isr (void) { PIE1bits.SSPIE = 0; …
Joost
  • 43
  • 4
2
votes
2 answers

Pic to PIc and PC USB how to?

I want to make an application where PIC18F4550 send its internal eeprom data to the pc through usb. Also i want to use the same usb connector to download the data to another PIC18F4550 over usb. How to use ex_usb_serial.c of ccs examples codes for…
Adnan
  • 193
  • 3
  • 8
2
votes
1 answer

Why doesn't this compile in C18?

I'm trying to compile the following code using the MPLAB C18 v3.36 compiler. Compiler returns a syntax error on 'char rij;'. But when i put char rij; a line earlier (before TRISA = ...), it compiles ... void setup(void) { TRISD = 0b00000000; …
Joost
  • 43
  • 4
2
votes
3 answers

USART transmit problems on a PIC

I'm trying to send data to an SD card from a PIC18f4580, but the PIC is not sending what it should be. related global variables: unsigned char TXBuffer[128]; //tx buffer unsigned char TXCurrentPos = 0x00; //tracks the next byte to be sent unsigned…
John Moffitt
  • 5,730
  • 7
  • 30
  • 39
2
votes
4 answers

Running code while waiting for code

I know this will sound absurdly simple. But I cannot think of, or adequately define to search for, how to have code in C to have a blinking LED going at a constant frequency while the rest of the program runs. Set and forget sort of thing. I have…
Chris
  • 21
  • 1
2
votes
1 answer

no chip name specified; use "PICC18 --CHIPINFO"

I did a simple program to light a led. #define _XTAL_FREQ 19660800 #define USE_AND_MASKS #include #include #include #include void main(void) { TRISA=0; PORTA=0; PORTA=0x5A; while (1) …
keating
  • 23
  • 1
  • 3
2
votes
1 answer

PIC 18F8722 variable declaration adresses

I know I can declare a variable in that way. variable udata 0x20 But what is the memory limit for this? Is variable udata 0x35 a valid instruction? I mean, can I use address 0x35? Is it spared to me, not SFRs? Also, how can calculate space…
mualloc
  • 495
  • 9
  • 24
2
votes
2 answers

Declaring large arrays on PIC18

I'm trying to declare a 512 byte array in MPLAB X v2.26, using compiler XC8 v1.32. My target is a PIC18F66K90 (4k of RAM). If I declare the array inside any function, main for example, I get an error. #define buffSize 512 int main (void) { …
2
votes
0 answers

PIC18F26J13, SPI2 mapped on PORTB, doesnt work

I am working on a project with a 18f26j13, where i need I2C on MSSP1, and SPI on MSSP2. my I2C works perfectly, but i cant get the SPI to work on port B, if i map them to port c, it works perfectly, so i am thinking that there is something i am not…
Heinrichs
  • 21
  • 2
2
votes
2 answers

reading pic18 rom constants with C18

I am struggling to understand why I get random data while trying to read from multidimensional table that is stored in rom. I have a table of bitmap character which I want to display on OLED screen. Table of characters is too big to fit into ram…
user2771538
  • 103
  • 1
  • 10
2
votes
1 answer

How to make timer0 use a prescaler of 1:64 in 16 bit mode?

I really do not have good understanding about timers, but I am trying to change timer0 to make it use a prescaler of 1:64 in 16 bit mode? I got the Timer code from Microchip and it is using 8 Bit mode with no prescaler. Download Files This is some…
Ammar
  • 1,203
  • 5
  • 27
  • 64
1 2
3
15 16