Search found 345 matches
- 30 Jun 2017 15:06
- Forum: mikroC PRO for PIC General
- Topic: Help!!!! PIC18F4685 Project 16MHz Clock
- Replies: 10
- Views: 3792
Re: Help!!!! PIC18F4685 Project 16MHz Clock
A couple of things 5. There is a clever way to have alternating red/green LEDs without using any 7400 series logic. I'll look it up and post later. Sorry for the delay. Here is the "clever way" I mentioned - as long as you don't mind having a continuous current draw i.e. when operating off batterie...
- 15 Jun 2017 11:09
- Forum: mikroC PRO for PIC General
- Topic: Help!!!! PIC18F4685 Project 16MHz Clock
- Replies: 10
- Views: 3792
Re: Help!!!! PIC18F4685 Project 16MHz Clock
A couple of things 1. You have the IntToStr arguments the wrong way around 2. You should drive the relay using the transistor's collector (not the emitter) 3. You should put a protection diode across the relay coil or you'll more than likely fry your transistor when the current to the relay is turne...
- 14 Jun 2017 12:53
- Forum: mikroC PRO for PIC General
- Topic: Help!!!! PIC18F4685 Project 16MHz Clock
- Replies: 10
- Views: 3792
Re: Help!!!! PIC18F4685 Project 16MHz Clock
Code: Select all
for(i = 0; i > 1500; i++ )
Not going to happen.
Edit: same goes for
Code: Select all
for(i = 0; i > 6; i++) //Memory Error Starting Loop
- 14 Jun 2017 09:45
- Forum: mikroC PRO for PIC General
- Topic: Peripheral Pin Selection in PIC18F25J50
- Replies: 1
- Views: 1372
Re: Peripheral Pin Selection in PIC18F25J50
I think
would be worth a try. I find that using bit notation makes settings clearer - for example:
Code: Select all
TRISC = 0x01;
Code: Select all
// 76543210 <-- Port number
TRISC = 0b00000001; // 1=Input, 0=Output
- 13 Jun 2017 11:51
- Forum: mikroC PRO for PIC General
- Topic: Reading Config bit PIC16F1847
- Replies: 2
- Views: 1865
Re: Reading Config bit PIC16F1847
Example 11-5 has
Was there a reason you didn't also do that?
Code: Select all
BCF INTCON,GIE ; Disable ints so required sequences will execute properly
- 13 Jun 2017 10:39
- Forum: mikroC PRO for PIC General
- Topic: zero switch
- Replies: 2
- Views: 1453
Re: zero switch
Code: Select all
tmp == take - tmp;
BTW, using code tags and proper indentation would make your code much easier to debug.
- 25 Apr 2017 07:58
- Forum: mikroC PRO for PIC General
- Topic: Improved way of coding string descriptors in USBdsc.c
- Replies: 2
- Views: 1912
Improved way of coding string descriptors in USBdsc.c
I've finally got around to fixing something that has been annoying me for a few years: having to count the bytes in USB string descriptors and set the length manually...then getting it wrong...then fixing it again...and experiencing the same pain for each new USB project :( Basically, what I do now ...
- 02 Apr 2017 04:49
- Forum: mikroC PRO for PIC General
- Topic: Anybody could help me to make USB composite device?
- Replies: 9
- Views: 4964
Re: Anybody could help me to make USB composite device?
Hi Filip,
I just tried (and failed) again to upload txt attachments again. It gives an upload progress indicator but then ignores the attachments.
I zipped them and successfully uploaded the zip attachment however.
Cheers,
A.
I just tried (and failed) again to upload txt attachments again. It gives an upload progress indicator but then ignores the attachments.
I zipped them and successfully uploaded the zip attachment however.
Cheers,
A.
- 27 Mar 2017 14:46
- Forum: mikroC PRO for PIC General
- Topic: Anybody could help me to make USB composite device?
- Replies: 9
- Views: 4964
Re: Anybody could help me to make USB composite device?
Hi sushizang, I'm sure this is working for you for now, but I've run your HID descriptor through a HID descriptor checking tool that I've written and it has reported a few issues...which may or may not be important - it really depends on how forgiving the various operating system HID parsers are (or...
- 17 Mar 2016 12:36
- Forum: mikroC PRO for PIC General
- Topic: Problems to compile an Array
- Replies: 2
- Views: 1201
Re: Problems to compile an Array
Or even this way... void sendDATA (char a) { unsigned char mask = 0b10000000; while (mask) { if (RB6_bit) { RB5_bit = a & mask; mask >>= 1; Delay_ms(2); } RB6_bit ^= 1; } } void main() { unsigned char bou = 0b00000000; ANSEL = 0; // pins are configured as digital I/O TRISA = 0xFF; // set direction t...
- 15 Mar 2016 22:21
- Forum: mikroC PRO for PIC General
- Topic: Very very annoying MikroC complier bug
- Replies: 6
- Views: 2150
Re: Very very annoying MikroC complier bug
If you are talking about the red squiggly lines then turn the spell checker off.
- 15 Mar 2016 13:34
- Forum: mikroC PRO for PIC General
- Topic: Interrupt for PIC18F45K20
- Replies: 2
- Views: 1040
Re: Interrupt for PIC18F45K20
A few tips: 1. For PIC18 devices, you should write to LAT registers and read from PORT registers (see example below). 2. Look at the *.lst file and you can see that the following if statement has been completely ignored (optimised away): if(TMR0IF == 1) I recommend using the _bit notation where poss...
- 27 Dec 2015 09:27
- Forum: mikroC PRO for PIC General
- Topic: Problem about read/write string with EEPROM. Need help
- Replies: 2
- Views: 1534
Re: Problem about read/write string with EEPROM. Need help
You could rule out serial synchronisation issues by coding
Code: Select all
UART1_Write_Text("123456789");
- 03 Oct 2015 10:14
- Forum: mikroC PRO for PIC General
- Topic: PIC18F2550 HID Keyboard + Generic Device
- Replies: 1
- Views: 1262
Re: PIC18F2550 HID Keyboard + Generic Device
The keyboard report descriptor looks ok, but the vendor defined descriptor *could* (I don't really know) be the problem. Currently you have defined: 0x06, 0x00, 0xFF, // (GLOBAL) USAGE_PAGE 0xFF00 Vendor-defined 0x09, 0x01, // (LOCAL) USAGE 0xFF000001 0xA1, 0x01, // (MAIN) COLLECTION 0x01 Applicatio...
- 27 Jul 2015 13:26
- Forum: mikroC PRO for PIC General
- Topic: Switch Operator
- Replies: 11
- Views: 3294
Re: Switch Operator
...at the risk of starting yet another code style war, this is is an excellent example of why aligning curly brackets is so important (well worth the extra carriage return and line feed). For example, I think we all agree that this is pretty rubbish... void main() { for (k=1; k<20; k++) { // remain ...