RC5

Any bugs you encounter with Flowcode should be discussed here.
ELECTRONICA67
Posts: 232
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 40 times
Been thanked: 11 times

Re: RC5

Post by ELECTRONICA67 »

Hi

I use the PIC16F1847 for RX and the PIC12F1840 for TX.

Saludos

ELECTRONICA67
Posts: 232
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 40 times
Been thanked: 11 times

Flowcode v11 Re: RC5

Post by ELECTRONICA67 »

Hi,

In fact, this circuit does much more than that and works correctly; these components are an addition to the circuit. I tried getting them to work by adding them, but since they didn't respond, I separated them from the main assembly. I want to get them working first so I can add them with the confidence that they function properly. I am keeping the PIC configuration the same so the components operate in the same environment. I think verifying that the components work individually is the best approach; once that is achieved, I can add them to the system. If they don't work then, I would suspect a timer conflict or some other issue, but at least I would be certain that the components themselves are working correctly.

I also performed the tests mentioned in points 1 and 2, and I ran the cell phone camera test as well; the IR LED is indeed transmitting a signal, but—as you said—I have no way of seeing it.

I find the macros for the RC5 and TM1637 4-digit display components quite simple to use; they don't require C code and should work with a basic example.

Is there any way someone from the MATRIX team could verify that these components work with the Microchip family—ideally with the specific PICs I'm using? If it turns out to be a bug, I could spend a year trying to get them to work without success.

or if you send me corrected files, I can run the tests myself without any issues.

I would appreciate it if you could take a look and help me out. If the error is on my end, I apologize, but if it is a bug, you would save me from wasting time trying to make them work when it simply isn't possible.

Best Regards and Thanks
Enrique

mnfisher
Valued Contributor
Posts: 2135
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 172 times
Been thanked: 987 times

Re: RC5

Post by mnfisher »

I've just attempted to test a 'transmit' with a PIC12F1840 (actually a 12LF1840 which is the low voltage version) - however I get a compilation error using the component:

Code: Select all

12f1840.c: myisr()
   977:	FCM_::Timer_Event();
	     ^ (195) expression syntax
  1017:	}
	^ (350) unused label "FCM_" (from line 0) (warning)
Which looks like a bug in the component (should be FCM_Timer_Event() ?)

mnfisher
Valued Contributor
Posts: 2135
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 172 times
Been thanked: 987 times

Re: RC5

Post by mnfisher »

As I couldn't get the component to transmit - I modified my code above to the 12f1840 (**** actually 12LF1840 - you might need to change this).

This gave:
LabNation_Screenshot73.png
LabNation_Screenshot73.png (157.6 KiB) Viewed 256 times
Note that one slight oddity - because the transmit is interrupt driven (and doesn't wait for completion at the moment) - the delay after the SendRC5 must be long enough for the transmission to complete. I used 50ms which gives ~25ms between transmissions - however the RC5 protocol requires more time than this to allow the AGC to cope!

The code uses two bits of C - one to enable a custom frequency for a carrier of 38kHz and one for a custom timer.

Martin
Attachments
RC5_Transmit_12LF1840.fcfx
(15.58 KiB) Downloaded 17 times

ELECTRONICA67
Posts: 232
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 40 times
Been thanked: 11 times

Re: RC5

Post by ELECTRONICA67 »

Hi,

I ran into that error too, but it stopped appearing after I recompiled.

Enrique

ELECTRONICA67
Posts: 232
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 40 times
Been thanked: 11 times

Flowcode v11 Re: RC5

Post by ELECTRONICA67 »

Hi Martin,

I was about to program the chip for testing—specifically the PIC12F1840—and I'm checking the "Project Options." I noticed some settings differ from my actual hardware setup: I'm using a 19.66 MHz crystal and have the WDT disabled. I wanted to tweak the settings, but it involves an expert level of programming that I don't fully understand yet (this is why I'm still following Flowcode 3 up to the current version 11); I'm not sure which options need to be changed to accommodate the 19.66 MHz crystal for testing the TX.

Saludos
Attachments
tx.jpeg
tx.jpeg (40.04 KiB) Viewed 245 times

mnfisher
Valued Contributor
Posts: 2135
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 172 times
Been thanked: 987 times

Re: RC5

Post by mnfisher »

Hi Enrique - i used the internal oscillator as a first test - this is 8MHz x4 (PLL) giving 32MHz...

Please could you test as is first as a 'sanity' check - just change the device to 12f1840.

If you change the clock speed we'll need to change the timer and carrier settings and if you change the output pin then a couple of other bits need changing too.

I'll help with these a little later in the day - which pin do you need as output ? - I just used RA2 as I'd used that for my blinkie test - first couple of times i tested i was getting no output at all despite everything looking okay. For some reason the /M had vanished from the programmer tab - and the PICKit was not actually writing anything to the chip 🙄

Martin

ELECTRONICA67
Posts: 232
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 40 times
Been thanked: 11 times

Flowcode v11 Re: RC5

Post by ELECTRONICA67 »

Hi Martin,

Okay, I'm using RA2 as the output; I'll switch the PIC to the 12F1840. I have some pending tasks to attend to, but I'll run the test immediately upon my return—in about five hours, I think.

Thanks

mnfisher
Valued Contributor
Posts: 2135
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 172 times
Been thanked: 987 times

Re: RC5

Post by mnfisher »

I think this should work with the 19.66MHz crystal? I haven't the facility to test though...
Attachments
RC5_Transmit_12LF1840.fcfx
(15.51 KiB) Downloaded 17 times

ELECTRONICA67
Posts: 232
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 40 times
Been thanked: 11 times

Flowcode v11 Re: RC5

Post by ELECTRONICA67 »

Hi Martin,

I wasn't able to run the tests today, but I can easily test with the 19.66 MHz crystal; in fact, that’s the one I have on the PCB.

Enrique

Post Reply