Search found 345 matches

by android
30 Jun 2017 15:06
Forum: mikroC PRO for PIC General
Topic: Help!!!! PIC18F4685 Project 16MHz Clock
Replies: 10
Views: 3775

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...
by android
15 Jun 2017 11:09
Forum: mikroC PRO for PIC General
Topic: Help!!!! PIC18F4685 Project 16MHz Clock
Replies: 10
Views: 3775

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...
by android
14 Jun 2017 12:53
Forum: mikroC PRO for PIC General
Topic: Help!!!! PIC18F4685 Project 16MHz Clock
Replies: 10
Views: 3775

Re: Help!!!! PIC18F4685 Project 16MHz Clock

Code: Select all

for(i = 0; i > 1500; i++ )
...means: set i to 0 and then do the following while i is greater than 1500.


Not going to happen. :)


Edit: same goes for

Code: Select all

for(i = 0; i > 6; i++) //Memory Error Starting Loop
by android
14 Jun 2017 09:45
Forum: mikroC PRO for PIC General
Topic: Peripheral Pin Selection in PIC18F25J50
Replies: 1
Views: 1369

Re: Peripheral Pin Selection in PIC18F25J50

I think

Code: Select all

TRISC = 0x01;
would be worth a try. I find that using bit notation makes settings clearer - for example:

Code: Select all

//        76543210  <-- Port number 
TRISC = 0b00000001; // 1=Input, 0=Output
by android
13 Jun 2017 11:51
Forum: mikroC PRO for PIC General
Topic: Reading Config bit PIC16F1847
Replies: 2
Views: 1861

Re: Reading Config bit PIC16F1847

Example 11-5 has

Code: Select all

BCF INTCON,GIE ; Disable ints so required sequences will execute properly
Was there a reason you didn't also do that?
by android
13 Jun 2017 10:39
Forum: mikroC PRO for PIC General
Topic: zero switch
Replies: 2
Views: 1447

Re: zero switch

Code: Select all

tmp == take - tmp;
...does not look right.

BTW, using code tags and proper indentation would make your code much easier to debug.
by android
25 Apr 2017 07:58
Forum: mikroC PRO for PIC General
Topic: Improved way of coding string descriptors in USBdsc.c
Replies: 2
Views: 1907

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 ...
by android
02 Apr 2017 04:49
Forum: mikroC PRO for PIC General
Topic: Anybody could help me to make USB composite device?
Replies: 9
Views: 4945

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.
by android
27 Mar 2017 14:46
Forum: mikroC PRO for PIC General
Topic: Anybody could help me to make USB composite device?
Replies: 9
Views: 4945

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...
by android
17 Mar 2016 12:36
Forum: mikroC PRO for PIC General
Topic: Problems to compile an Array
Replies: 2
Views: 1193

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...
by android
15 Mar 2016 22:21
Forum: mikroC PRO for PIC General
Topic: Very very annoying MikroC complier bug
Replies: 6
Views: 2140

Re: Very very annoying MikroC complier bug

If you are talking about the red squiggly lines then turn the spell checker off.
by android
15 Mar 2016 13:34
Forum: mikroC PRO for PIC General
Topic: Interrupt for PIC18F45K20
Replies: 2
Views: 1030

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...
by android
27 Dec 2015 09:27
Forum: mikroC PRO for PIC General
Topic: Problem about read/write string with EEPROM. Need help
Replies: 2
Views: 1527

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");
by android
03 Oct 2015 10:14
Forum: mikroC PRO for PIC General
Topic: PIC18F2550 HID Keyboard + Generic Device
Replies: 1
Views: 1258

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...
by android
27 Jul 2015 13:26
Forum: mikroC PRO for PIC General
Topic: Switch Operator
Replies: 11
Views: 3285

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 ...

Go to advanced search