EmbeddedRelated.com
The 2024 Embedded Online Conference

MCC18 / PIC C18 - how to write to internal EEPROM?

Started by Royston Vasey in comp.arch.embedded14 years ago 3 replies

I'm new to C and am trying to write a byte to the internal EEPROM in a 18F45k20. I've done this in the past using assembly but now I'm...

I'm new to C and am trying to write a byte to the internal EEPROM in a 18F45k20. I've done this in the past using assembly but now I'm working in C I figure there should be a function for doing this. I've found reference to write_b_eep and read_b_eep on the net but cannot see any reference to these in the MPLAB C18 Compiler Libraries documentation. What is the way to approach this? ...


Strange behavior of RA4 and RA5 on PIC18F242

Started by Paul E. Schoen in comp.arch.embedded17 years ago 6 replies

Hello, I am new to this NG, but my question seemed more appropriate here than on SED. I'm using a PIC18F242 for an SCR controller, and...

Hello, I am new to this NG, but my question seemed more appropriate here than on SED. I'm using a PIC18F242 for an SCR controller, and programming it in assembly with MPLAB 7.30. I am using RA4 as an Output On indicator, driving an LED and an optoisolator through a series resistor to +5VDC. I use RA5 to drive a status LED, low for green and high for red. Everything worked fine whe...


simulation tutorial? Asynchronous interrupts?

Started by mike in comp.arch.embedded10 years ago 5 replies

I'm writing simple programs for a PIC 16F877A. Attempting to simulate with MPLAB. Linear code...no problem. But I've never written a...

I'm writing simple programs for a PIC 16F877A. Attempting to simulate with MPLAB. Linear code...no problem. But I've never written a program that didn't have multiple asynchronous interrupt inputs and timers. The MPSIM seems to fall apart in that instance. Yes, there are ways to simulate inputs, but the asynchronous nature is where all the problems happen. State another way, no pro...


PIC 18F4455 simple project help

Started by CMOS in comp.arch.embedded16 years ago 8 replies

hi, i've started playing with 18F4455 device. im using MPLAB with c18 compiler student version. as a start what am trying to do is to light an...

hi, i've started playing with 18F4455 device. im using MPLAB with c18 compiler student version. as a start what am trying to do is to light an LED connected to pin 6 (RA4). here is the code. #include #pragma config WDT = OFF void main() { ADCON1 = 0x0F; CMCON = 0x07; TRISA = 0xCF; LATAbits.LATA4 = 1; while(1); } how ever the LED in the target circuit does not


Detailed memory usage by module on a PIC18

Started by Nickolai Leschov in comp.arch.embedded16 years ago 8 replies

Hello, I have a legacy project for PIC18F452 that compiles with HI-TECH Software C Compiler, using MPLAB IDE. The device's flash program...

Hello, I have a legacy project for PIC18F452 that compiles with HI-TECH Software C Compiler, using MPLAB IDE. The device's flash program memory is nearly full and I'm curious to see what occupies most of this space. How can I see memory footprint of compiled program, by modules? The project consists of 19 'C' files; if the compiler told me how much memory each one uses, that would be...


Programming my PIC chip in Linux

Started by in comp.arch.embedded16 years ago 1 reply

I'm running Ubuntu Linux. I have a C project that I want to compile and upload to my PIC chip (the PIC16F684 to be exact). I've already...

I'm running Ubuntu Linux. I have a C project that I want to compile and upload to my PIC chip (the PIC16F684 to be exact). I've already gotten the PIC Lite C complier from htsoft.com, but I need an application for uploading the machine code to the chip. Windows users use a thing called MPLAB, but I can't get this for Linux. Can anyone please suggest a Linux alternative? I don't nee...


Really confused by my debugger.

Started by Brendan Gillatt in comp.arch.embedded17 years ago 4 replies

I recently purchased a clone Microchip PIC debugger from some Chinese importer http://www.virtualvillage.co.uk/Items/006401-001? (bad...

I recently purchased a clone Microchip PIC debugger from some Chinese importer http://www.virtualvillage.co.uk/Items/006401-001? (bad idea probably, I know). I set it all up, it programs perfectly and does a POST fine. The problem is with debugging. I hit the 'program' button on MPLAB, the PIC is programmed fine but I get an 'ICD0083' error (cannot enter the debug mode on the chip). I'v...


MPLAB_6v5: project working directory - can't set to "sticky"

Started by robi...@tesco.net in comp.arch.embedded20 years ago 2 replies

How do you setup the IDE in MPLAB_6V5 so that File/Open points to your working directory and not to "myDocuments" when you first open your...

How do you setup the IDE in MPLAB_6V5 so that File/Open points to your working directory and not to "myDocuments" when you first open your project. (i.e. the "sticky" option in MPLAB 5V7) TIA Robin


C18 calculation question - novice...

Started by Dennis in comp.arch.embedded13 years ago 13 replies

I'm trying to interface a SHT21 humidity sensor to a PIC (and learning C18 along the way, MPLAB, C18, PIC18LF44K22). A 16 bit serial value,...

I'm trying to interface a SHT21 humidity sensor to a PIC (and learning C18 along the way, MPLAB, C18, PIC18LF44K22). A 16 bit serial value, S_RH, is read from the sensor. To convert this value into relative humidity, RH, it needs to be inserted into an equation. RH = (125 x S_RH)/ 2^16 - 6 The data sheet gives a test value of S_RH = 25424 giving RH = 42.5% which works nicely. ...


PIC 18 Series - HS+PLL Enabled Clock Mode

Started by John Lucas in comp.arch.embedded20 years ago 2 replies

Hi I am using a PIC18F452 with an external 8MHz crystal. I am trying to enable the HS+PLL Enabled mode, the device programs okay, and...

Hi I am using a PIC18F452 with an external 8MHz crystal. I am trying to enable the HS+PLL Enabled mode, the device programs okay, and when read back, the configuration values are correct, however, in use, the device is still running at 8MHz. I am using MPLAB 6.62 with an ICDII. Can anyone suggest a reason why the PLL may not be working. Thanks John Lucas


What am I doing wrong?

Started by Julian Morrison in comp.arch.embedded19 years ago 23 replies

--nextPart2912043.rat7JAi7FX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit I'm trying to code a very simple...

--nextPart2912043.rat7JAi7FX Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit I'm trying to code a very simple LED flasher as a starter app, and I can't get the damn thing to work. (This is on PIC16F627 and simulated on MPLAB.) The timer1 rollover never fires. Code follows as attachment. Can someone tell me what I'm doing wrong? --nextPart2912043.rat7JAi7FX ...


writing to Program memory in PIC controllers

Started by aroravaibhav87 in comp.arch.embedded16 years ago 13 replies

Hi! With reference to the...

Hi! With reference to the doc http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=38003&start=all&postdays=0&pos torder=asc ,it's possible to write directly into the program memory section in AVR controller ,I would like to know whether it is possible to follow a similar kind of procedure for PIC controllers as well. (I use an MPLAB v7 for programming the PICs ) Thanks in


Menus on LCD for embedded systems

Started by murp...@yahoo.com in comp.arch.embedded16 years ago 13 replies

Hi I want to have menus (with sub menus and so on) on a LCD (graphics LCD and I can have about 4 lines on it) of an embedded system. I am...

Hi I want to have menus (with sub menus and so on) on a LCD (graphics LCD and I can have about 4 lines on it) of an embedded system. I am programming in C (MPLAB C18 does not support C++). The system has three keys, UP, DOWN and ENTER. I have searched a lot on the internet for data structures and methods for such applications. I have found that lot of people say pointer to functions can...


IC2 problem with PIC16F877#

Started by John Smith in comp.arch.embedded16 years ago 6 replies

Hi, Our laboratory recently purchased a MPLAB ICD2 programmer. Everytime I try to program my PIC etheir by using the "Debugger" or the...

Hi, Our laboratory recently purchased a MPLAB ICD2 programmer. Everytime I try to program my PIC etheir by using the "Debugger" or the "Programmer" mode I receive this error: ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0x283A, Val Read = 0x0) I looked the forum and people seem to think that it is related to the vdd voltage or maybe that the ICD 2...


dsPIC problem

Started by Syd Rumpo in comp.arch.embedded13 years ago 12 replies

Hello I have an odd problem with some dsPIC code. I'm using MPLAB and a dsPIC Starter Kit 1. I have some C code calling an assembler...

Hello I have an odd problem with some dsPIC code. I'm using MPLAB and a dsPIC Starter Kit 1. I have some C code calling an assembler routine - in fact the Microchip FFT stuff. It doesn't work and causes the processor to hang or reset or go off on a jaunt - not sure which. I have three LEDs which the C code turns on if/when the assembler routine returns. If I put the appropriat...


pic16f877a uart c code problm

Started by sivaramakrishna in comp.arch.embedded15 years ago 5 replies

Hai to all, Iam trying to communicate from pic 16f877a to the pc's hyperterminal at 9600 baud rate. Iam posting my code for this. Iam able...

Hai to all, Iam trying to communicate from pic 16f877a to the pc's hyperterminal at 9600 baud rate. Iam posting my code for this. Iam able to simulate with mplab but I could not implement with hardware. I checked for max232, rs232. They seem to be working perfect. But iam not getting the data through hyperterminal comm port. My crystal oscillator is 8mhz. /* uart serial communicati...


dsPIC software Interrupt generation problem

Started by nandlal in comp.arch.embedded16 years ago

Hi, I have been using dspic30f4011, for the external interrupt if the Pin is defined as input. So how the user can generate interrupt...

Hi, I have been using dspic30f4011, for the external interrupt if the Pin is defined as input. So how the user can generate interrupt by manually changing the port pin status in MPLAB SIM ? Because once its defined as input user cannot modify the PORT value. Is there any alternate or only option is to use ICD tool


Dummy C18 question re using header files

Started by DTJ in comp.arch.embedded10 years ago 8 replies

Hopefully someone can point me in the right direction without too much mirth...... I'm using an generic 4x16 LCD with a Pic + MPLAB + ...

Hopefully someone can point me in the right direction without too much mirth...... I'm using an generic 4x16 LCD with a Pic + MPLAB + C18 free compiler. I need to use the xlcd.h header file. The xlcd.h file is supplied with the C18 package and seems to be where pins for the LCD control etc are defined. Do I simply copy this file into the project directory and edit it? ...


ICD 2 for PIC12F509

Started by Jame...@gmail.com in comp.arch.embedded18 years ago 1 reply

I'm trying to program/debug an 8 pin PIC12F509 (8 pin version with 8 DIP packaging) with the AC162059 header. The MPLAB IDE claims that...

I'm trying to program/debug an 8 pin PIC12F509 (8 pin version with 8 DIP packaging) with the AC162059 header. The MPLAB IDE claims that the chip is there, and I try and program it and it all claims that it was sucessfull...when in fact the pic wasn't even in the socket. Also, it seems to "simulate" the chip wihout the chip in there. When I try and download the file registers while in debug...


PIC18F252 Interrupts

Started by PigPOg in comp.arch.embedded17 years ago 2 replies

Can anyone shed some light on this problem please? It's likely to be something simple that I've overlooked. I'm using MPLAB 7.5 running on XP...

Can anyone shed some light on this problem please? It's likely to be something simple that I've overlooked. I'm using MPLAB 7.5 running on XP SP2. It's simple assembly code that services INT0 on the falling edge of port RC0 and services INT1 on the falling edge of RC2. Everything works OK except that should RC2 become active while INT0 is being serviced, as soon as the INT0 ISR completes...



The 2024 Embedded Online Conference