Can all the outputs be on the same port, preferably sequential?
Can all the outputs be on the same port, preferably sequential?
Warning I'm not a teacher
As Henrik pointed, I'm somehow limited in the number of bytes I can use to address the NeoPixel strings.Can all the outputs be on the same port, preferably sequential?
Because of the very narrow timings, I cannot use routines to address the strings repeatetely with GOTOs/FOR-NEXTs/GOSUBs and so on. For this reason, I have to write code to address 24 bits for one Pixel in a row and only here, I can repeat the routine with one of the previous mentionned commands. This to say there is not only a timing issue but it is also about code length or space in the PIC.
Having this limitations in mind, I started my project addressing one string at the time and I've got plenty of time to display a minute based clock. Since all strings use the same common code and therefore the same variables, I can only differentiate them using different ports.
So if you mean to have only one NeoPixel string made of (4 digits x 7 segments x 4 Pixels [or LEDs] x 3 bytes per Pixel) + (4 Pixels x 3 bytes per Pixel) = 348 bytes, I can't address them in an array, as far as I understand it.
But what do you have in mind, please?
Last edited by flotulopex; - 24th July 2024 at 14:53.
Roger
There is an easier protocol for addressable LEDs. The APA102 that is not strict on timing.
https://learn.sparkfun.com/tutorials...okup-guide/all
Ioannis
Last edited by Ioannis; - 25th July 2024 at 22:21.
a 16f690 has 3 ports A,B and C by different ports do you mean different pins ?Having this limitations in mind, I started my project addressing one string at the time and I've got plenty of time to display a minute based clock. Since all strings use the same common code and therefore the same variables, I can only differentiate them using different ports.
Can all the outputs be on the same port, preferably sequential?
ie RC0:4 OR RC3:7 or similar
Warning I'm not a teacher
Yes, ports will be in a sequential order.
I'll be using ports:
- Seconds: PORTC.3
- Minutes Units: PORTC.4
- Minutes Thenths: PORTC.5
- Hours Units: PORTC.6
- Hours Tenths: PORTC.7
16F690 has:
PORTA.0..5
PORTB.4..7
PORTC.0..7
Last edited by flotulopex; - 25th July 2024 at 07:41.
Roger
By changing pinsel var you can select different portc pins
if you need the remaining portc pins then more code is needed
Code:' PIC 16F690 @20MHz#CONFIG __config _FCMEN_OFF &_IESO_OFF &_CPD_OFF &_WDT_OFF &_HS_OSC &_BOR_OFF &_CP_OFF &_PWRTE_OFF &_MCLRE_OFF #ENDCONFIG TRISC = %00000000 DEFINE OSC 20 pinsel var byte pinsel = 128 ; 64 FOR RC:6 32 FOR RC:5 ETC MAIN: PORTC = PORTC | pinsel ASM nop nop nop ENDASM PORTC = 0 ' have this syntax for tests only here ASM nop ENDASM GOTO MAIN END
Warning I'm not a teacher
have you tried to light a rgb led strip with a 690 @20mHz yet ?
i have doubts that such a slow chip will do the deed
Warning I'm not a teacher
Bookmarks