Search found 1179 matches
- 22 Aug 2018 17:18
- Forum: mikroC PRO for PIC General
- Topic: PIC16F876A - PortC 3, 4, 5 are not outputing
- Replies: 5
- Views: 2508
Re: PIC16F876A - PortC 3, 4, 5 are not outputing
Forum members can't provide you good advice if you don't supply correct or complete information. Proof read your post before submitting next time. Last thing to check is, make sure the MSSP module (I2C/SPI) is disabled if you are not planning to use it. SSPCON1.SSPEN = 0; // <bit 5> disable MSSP mod...
- 21 Aug 2018 22:55
- Forum: mikroC PRO for PIC General
- Topic: PIC16F876A - PortC 3, 4, 5 are not outputing
- Replies: 5
- Views: 2508
Re: PIC16F876A - PortC 3, 4, 5 are not outputing
This is because you configured all pins of PortC as inputs.Problem: PortC pin 3 ,4 and 5 can not output anything
Code: Select all
TrisC = 0xFF ' Set Port C to digital output
- 11 Aug 2018 00:17
- Forum: mikroC PRO for PIC General
- Topic: Program Manager and Include Files
- Replies: 2
- Views: 1547
Re: Program Manager and Include Files
The #include *.h header file declaration(s) must be placed at the very top of the *.c source file(s). This is very important because code elements below these are use to inform the linker where to get things like functions, variable types + sizes, arguments or pointers passed, constants ect... so it...
- 03 Aug 2018 19:28
- Forum: mikroC PRO for PIC General
- Topic: How does the DS2401 SN fit into an Unsigned Long?
- Replies: 2
- Views: 1466
Re: How does the DS2401 SN fit into an Unsigned Long?
Quick answer... you can't using standard variable types. The compiler only supports a 32-bit sized variable type. But this does not mean you can't perform useful tests on the data like comparing the SN to a number you are looking for. It just requires a bit more processing effort to do so. In this s...
- 30 Apr 2018 02:47
- Forum: mikroC PRO for PIC General
- Topic: breaking out of the loop problems
- Replies: 2
- Views: 1066
Re: breaking out of the loop problems
PORTC.f0 ==0; PORTC.f0 ==1; should be... PORTC.f0 = 0; PORTC.f0 = 1; A single "=" is the assignment operator i.e. X = 9; or X is assigned the value 9. A double "==" is the "equal to" operator only used when performing relational comparison tests i.e. if (x == 9) { do something} --- if (previous2 && ...
- 28 Mar 2018 04:16
- Forum: mikroC PRO for PIC General
- Topic: PCF8583 time changes every Spring and Fall
- Replies: 6
- Views: 2099
Re: PCF8583 time changes every Spring and Fall
Can anyone give me a suggestion on how to handle the time changes every Spring and Fall? Daylight Saving Time (DST) begins at 2:00 a.m. on the second Sunday in March and reverts to standard time on the first Sunday in November. Read and compare the RTCC time, date, and day of the week registers for...
- 15 Mar 2018 03:27
- Forum: mikroC PRO for PIC General
- Topic: I2C Issue with PIC18F4550
- Replies: 7
- Views: 2351
Re: I2C Issue with PIC18F4550
I suspect the mikroC I2C initialization is not taking into account the high clock speed. You might try adjusting the system clock postscaler setting in the compiler "edit project" window. Doing so will lower the clock frequency that drives the peripherals internally. If you study the datasheet oscil...
- 14 Mar 2018 23:39
- Forum: mikroC PRO for PIC General
- Topic: I2C Issue with PIC18F4550
- Replies: 7
- Views: 2351
Re: I2C Issue with PIC18F4550
Don't forget to set the TRIS registers and disable the analog functions for the I2C port pins too.
- 14 Mar 2018 23:25
- Forum: mikroC PRO for PIC General
- Topic: I2C Issue with PIC18F4550
- Replies: 7
- Views: 2351
Re: I2C Issue with PIC18F4550
Do you have pull-up resistors on the bus lines?
- 28 Feb 2018 05:39
- Forum: mikroC PRO for PIC General
- Topic: multidimensional arrays ... how to?
- Replies: 4
- Views: 1450
Re: multidimensional arrays ... how to?
100 messages of 128 bytes each = 12800 bytes. Regardless of the coding methodology the sheer quantity of data you expect to store will exceed the RAM space offerings for all 8-bit PIC family of devices (8k max). Moving to a 16-bit or 32-bit PIC device will increase RAM space size offerings to fit yo...
- 26 Feb 2018 00:38
- Forum: mikroC PRO for PIC General
- Topic: toggling bis
- Replies: 1
- Views: 799
Re: toggling bis
To toggle a bit mikroC has the "sbit" command. See help file.
Another way to toggle the bit state is to use bitwise masking.
ex...
x = x & 0xFE; // this clears bit 0 to 0 using bitwise AND function
x = x | 0x01; // this sets bit 0 to 1 using bitwise OR function
Another way to toggle the bit state is to use bitwise masking.
ex...
x = x & 0xFE; // this clears bit 0 to 0 using bitwise AND function
x = x | 0x01; // this sets bit 0 to 1 using bitwise OR function
- 10 Feb 2018 20:28
- Forum: mikroC PRO for PIC General
- Topic: coding do if else statement
- Replies: 3
- Views: 1399
Re: coding do if else statement
Add...
Code: Select all
TRISA = 0b00000000;
- 09 Feb 2018 06:24
- Forum: mikroC PRO for PIC General
- Topic: Electrical interferences awake my device. Routine to deal ?
- Replies: 11
- Views: 2896
Re: Electrical interferences awake my device. Routine to dea
If you haven't already fixed this... if ((INTCON.RBIF == 1) && (INTCON.RBIE=1)) should be... if ((INTCON.RBIF == 1) && (INTCON.RBIE == 1)) Better still... if ((INTCON.RBIF) && (INTCON.RBIE)) Also the IOC is not a very good idea when using mechanical switches because the IOC hardware does not provide...
- 02 Jan 2018 18:37
- Forum: mikroC PRO for PIC General
- Topic: Timer1 and ADC interrupt together problem
- Replies: 4
- Views: 1697
Re: Timer1 and ADC interrupt together problem
You forgot to clear the timer 1 interrupt flag bit after servicing the interrupt.
- 23 Dec 2017 20:51
- Forum: mikroC PRO for ARM General
- Topic: I am looking for an example for the AD8402
- Replies: 2
- Views: 1201
Re: I am looking for an example for the AD8402
Why not try reading the datasheet first and make an attempt to learn how to write the code yourself before asking others to do it for you? This is a very simple device to write code for.hi, does anyone have an example code for the AD8402 for me?
SPI, shift out 2 bytes, address byte then data byte.