Author |
Message |
Topic: How to write and read from int_eeprom more then 256 ? |
Eric Minbiole
Replies: 2
Views: 4595
|
Forum: General CCS C Discussion Posted: Sat Oct 07, 2006 10:16 am Subject: How to write and read from int_eeprom more then 256 ? |
This entry from the FAQ describes how to save larger variables (such as floats) to the EEPROM:
http://ccsinfo.com/faq.php?page=write_eeprom_not_byte |
Topic: Light timer |
Eric Minbiole
Replies: 4
Views: 6790
|
Forum: General CCS C Discussion Posted: Sat Jan 28, 2006 7:29 am Subject: Light timer |
To make the logic easier, I would make a small helper routine that simply compares two times, taking into account that hours are more significant than minutes. The example below returns +1 if A>B, ... |
Topic: 4 to 20 mA converted to voltage |
Eric Minbiole
Replies: 9
Views: 9723
|
Forum: General CCS C Discussion Posted: Fri Dec 02, 2005 8:17 am Subject: 4 to 20 mA converted to voltage |
Something like this should do the trick:
#define MINIMUM_READING 0.204
#define MAXIMUM_READING 1.02
#define MAXIMUM_DISTANCE 2.0
...
fInches = MAXIMUM_DISTANCE * (fVolts - MINIMUM_R ... |
Topic: Repeated conditional compilation? |
Eric Minbiole
Replies: 2
Views: 4683
|
Forum: General CCS C Discussion Posted: Sat Nov 26, 2005 8:00 pm Subject: Repeated conditional compilation? |
I don't think there is any way to do this sort of thing directly within C. As an alternative, you could do the calculations at runtime (perhaps at startup), storing the results in RAM. (It looks to ... |
Topic: Writing a function to check passwords |
Eric Minbiole
Replies: 8
Views: 8678
|
Forum: General CCS C Discussion Posted: Thu Nov 17, 2005 7:07 pm Subject: Re: Writing a function to check passwords |
You've declared rx_pw as a char pointer, but you haven't allocated any storage for it. The call to gets() is likely stomping on some random location in RAM. I would change its declaration to somethi ... |
Topic: Problem char to long |
Eric Minbiole
Replies: 1
Views: 3967
|
Forum: General CCS C Discussion Posted: Wed Nov 16, 2005 9:35 pm Subject: Problem char to long |
I see two problems:
1. The reason 300 "overflows" back to 44 is that "atoi()" only returns an 8 bit value. Even though you are assigning it to 16 bit Ti_Result, it has already overflowed. Use the ... |
Topic: FET Latch-up During Programming |
Eric Minbiole
Replies: 3
Views: 5864
|
Forum: General CCS C Discussion Posted: Fri Nov 04, 2005 8:04 am Subject: FET Latch-up During Programming |
Glad to hear the circuit is working now.
I don't think the problem you are seeing has anything to do with "Latch up". Here's a quick explanation of what's happening:
A PIC's I/O pins can have o ... |
Topic: FET Latch-up During Programming |
Eric Minbiole
Replies: 3
Views: 5864
|
Forum: General CCS C Discussion Posted: Thu Nov 03, 2005 8:46 pm Subject: FET Latch-up During Programming |
is also pulled up w/ a 10K. The Fan operates at 5V, 400mA, and the PIC is at 3.3V. The fan is on with output high.
It sounds to me that the problem is with your 10K pull up resistor: When the PIC i ... |
Topic: audio generation using a pic - help is greatly needed..... |
Eric Minbiole
Replies: 5
Views: 11583
|
Forum: General CCS C Discussion Posted: Wed Feb 23, 2005 11:23 am Subject: audio generation using a pic - help is greatly needed..... |
You can definitely play simple notes with a PIC. One of the simplest ways is to connect a Piezo speaker to the PWM output of the PIC. You can vary the PWM frequency to get a good range of notes. (T ... |
Topic: Set_UART_Speed() How does this work ? |
Eric Minbiole
Replies: 5
Views: 10770
|
Forum: General CCS C Discussion Posted: Sat Jul 31, 2004 11:57 am Subject: Set_UART_Speed() How does this work ? |
or is there "stuff" that CCS hides ? I thought the LST included everything .
Yes, by default, CCS hides the code for a lot of their 'library' functions. Take a look at the #list & #nolist dire ... |
Topic: PIC power consumption |
Eric Minbiole
Replies: 19
Views: 33957
|
Forum: General CCS C Discussion Posted: Sat Jul 31, 2004 11:42 am Subject: PIC power consumption |
Radio Shack used to sell a great book called "Enercell Battery Guidebook". It has sections for virtually every standard type of battery (AA, D, C, 9V, 'coin cells', lithium, etc). Within each sectio ... |
Topic: Timing Problem? (3 UART) |
Eric Minbiole
Replies: 6
Views: 13167
|
Forum: General CCS C Discussion Posted: Sat Jul 31, 2004 11:20 am Subject: Timing Problem? (3 UART) |
The biggest thing that strikes me is the call to
Ch = fgetc(SLOW_DEV);
within the RTCC isr. The call to kbhit() should be very fast, and should not take significant time. However ... |
Topic: A/D problem in 18LF6720 |
Eric Minbiole
Replies: 3
Views: 9609
|
Forum: General CCS C Discussion Posted: Wed Jun 23, 2004 9:31 pm Subject: A/D problem in 18LF6720 |
Oops... I miscalculated the watchdog timeout. It's not 128 ms, but 128 x Watchdog Period, Twdt. According to the datasheet, this can be as low as 7ms. At that period, the timeout is 7ms * 128 count ... |
Topic: A/D problem in 18LF6720 |
Eric Minbiole
Replies: 3
Views: 9609
|
Forum: General CCS C Discussion Posted: Wed Jun 23, 2004 9:12 pm Subject: A/D problem in 18LF6720 |
It looks to me like the watchdog is timing out (and restarting your program) during the 1 second "delay_ms(1000)" calls. (The watchdog is configured for 128ms timeout.)
Try changing your #use de ... |
Topic: off topics : looking for datasheet |
Eric Minbiole
Replies: 4
Views: 11723
|
Forum: General CCS C Discussion Posted: Fri Jun 18, 2004 7:08 am Subject: off topics : looking for datasheet |
Heres a link to Atmel's AT90SC3232CS page. It has the datasheet, and other good info:
On Edit: Ooops... I just noticed that even Atmel's datasheet doesn't seem to have the pin diagrams. I guess I ... |
|