Author |
Message |
Topic: OT: How do you design your Microcontroller Code? |
Freddie
Replies: 5
Views: 7248
|
Forum: General CCS C Discussion Posted: Sun Nov 02, 2008 4:58 pm Subject: OT: How do you design your Microcontroller Code? |
How do you design your projects?
I used to start writing my code before I had a clear plan. That was always a disaster.
Now before writing any code I start with a clean piece of paper and s ... |
Topic: time to transmit and execute |
Freddie
Replies: 7
Views: 6114
|
Forum: General CCS C Discussion Posted: Sat Nov 01, 2008 8:10 am Subject: time to transmit and execute |
You could time it exactly in a test program.
// This code is not complete, just an example algorithm of sorts.
#use delay(clock=8000000)
int16 EventTime;
setup_timer_1 ( ... |
Topic: Interrupts |
Freddie
Replies: 5
Views: 14483
|
Forum: General CCS C Discussion Posted: Wed Oct 29, 2008 4:43 pm Subject: Interrupts |
Thanks. A few more questions...
Similarly, even when the global is disabled, the timer1 and timer0 remain enabled.
So what does enable_interrupts(GLOBAL) actually do then?
can still ... |
Topic: Interesting problem with hyperterminal |
Freddie
Replies: 12
Views: 12153
|
Forum: General CCS C Discussion Posted: Tue Oct 28, 2008 8:19 pm Subject: Interesting problem with hyperterminal |
I never did like Hyperterminal. I use a free program called TeraTermPro v2.3. It works like champ.
http://hp.vector.co.jp/authors/VA002416/teraterm.html |
Topic: Interrupts |
Freddie
Replies: 5
Views: 14483
|
Forum: General CCS C Discussion Posted: Tue Oct 28, 2008 8:04 pm Subject: Interrupts |
I'm trying to understand how interrupts work. Is there a good tutorial somewhere?
Question #1
To turn on the INT_TIMER1 is it better to do this:
enable_interrupts(GLOBAL);
enable_i ... |
Topic: Read and Write 16 Bit Number To Internal EEPROM |
Freddie
Replies: 14
Views: 25532
|
Forum: General CCS C Discussion Posted: Sun Oct 26, 2008 6:51 pm Subject: Read and Write 16 Bit Number To Internal EEPROM |
I think I figured it out.
I use Microchip MPLAB, Microchip ICD2 and PCM 3.245.
When I made and ran the test program I was not using any breakpoints. When I ran the "real" program ... |
Topic: Read and Write 16 Bit Number To Internal EEPROM |
Freddie
Replies: 14
Views: 25532
|
Forum: General CCS C Discussion Posted: Sun Oct 26, 2008 6:22 pm Subject: Read and Write 16 Bit Number To Internal EEPROM |
I built a test program per PCMP's suggestion and the test program works fine.
However, my "real" program still does not write to the EEPROM!!! There must be something else somewhere in ... |
Topic: Read and Write 16 Bit Number To Internal EEPROM |
Freddie
Replies: 14
Views: 25532
|
Forum: General CCS C Discussion Posted: Sun Oct 26, 2008 5:27 pm Subject: Read and Write 16 Bit Number To Internal EEPROM |
I'm using CCS compiler version 3.245.
I changed it to use the make8 and make16 functions, see below.
Everything works except that it does not actually write to the EEPROM, I'm sure of that.
... |
Topic: Read and Write 16 Bit Number To Internal EEPROM |
Freddie
Replies: 14
Views: 25532
|
Forum: General CCS C Discussion Posted: Sun Oct 26, 2008 4:02 pm Subject: Read and Write 16 Bit Number To Internal EEPROM |
If you want to split and combine bytes into a word, it can be done much
more easily and error-free if you use the make8() and make16()
functions. These are in the CCS manual.
Thats a good idea ... |
Topic: Read and Write 16 Bit Number To Internal EEPROM |
Freddie
Replies: 14
Views: 25532
|
Forum: General CCS C Discussion Posted: Sun Oct 26, 2008 3:45 pm Subject: Read and Write 16 Bit Number To Internal EEPROM |
Thanks PCMP, I knew about having to reload the EEPROM data.
After tinkering with this a bit more I found that the issue is with these two lines:
//Put the Value back into Upper and Lower
Tem ... |
Topic: Read and Write 16 Bit Number To Internal EEPROM |
Freddie
Replies: 14
Views: 25532
|
Forum: General CCS C Discussion Posted: Sun Oct 26, 2008 2:11 pm Subject: Read and Write 16 Bit Number To Internal EEPROM |
I'm using PIC16F876A.
I need to read a two byte 16 bit number out of internal EEPROM, increment it and write it back to EEPROM. The code below works ok for reading it out and incrementing it. It ... |
Topic: Should I upgrade from PCM v3.245 |
Freddie
Replies: 4
Views: 5859
|
Forum: General CCS C Discussion Posted: Sat Apr 05, 2008 9:13 am Subject: Should I upgrade from PCM v3.245 |
There were some bug fixes between 3.245 and 3.249. That version is stable and relatively bug free.
I think I can stick with v3 for now. Which version is relatively bug free, V2.245 or V3.249? |
Topic: Should I upgrade from PCM v3.245 |
Freddie
Replies: 4
Views: 5859
|
Forum: General CCS C Discussion Posted: Fri Apr 04, 2008 2:29 pm Subject: Should I upgrade from PCM v3.245 |
I have several 16F84, 16F876A and 16F877A projects running with code compiled using PCM v3.245. They have all been running fine for over a year now in a production environment.
I need to make so ... |
Topic: String to Hex number |
Freddie
Replies: 3
Views: 5639
|
Forum: General CCS C Discussion Posted: Thu Jun 21, 2007 5:19 pm Subject: String to Hex number |
Works perfect. Thanks PCM programmer. |
Topic: String to Hex number |
Freddie
Replies: 3
Views: 5639
|
Forum: General CCS C Discussion Posted: Wed Jun 20, 2007 10:37 am Subject: String to Hex number |
Using Compiler PCM 3.242, PIC 16F877.
I have a string of variable length that is received from another device via serial port in the following format (without quotes)
"data7E3B99D7"
... |
|