• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Neo Pixel RAM Assign

Status
Not open for further replies.

Suraj143

Active Member
I like to build a Neo pixel 8 X 32 matrix type pattern display. Like to work with a modern PIC which has a CLC module with assembly language.
My question is, To drive the above 256 pixels do I need 256 RAM locations?Is there any code compact method to do with minimum RAMs. Because in future I like to do a 16X32 as well, so I more concern on RAMs.

Thanks
 
Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member
If your pattern is fixed, then you can store it in program memory rather than RAM. Even if it's in RAM, it has to be stored somewhere else to be moved there.
 

Suraj143

Active Member
Hi,

My patterns are moving patterns Ex: Arrow Symbol moving from bottom to top.For the time being I placed the arrow symbol data in a table read location & call them when I want & make a shift up to make it move up.

That's my plan.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Hi,

My patterns are moving patterns Ex: Arrow Symbol moving from bottom to top.For the time being I placed the arrow symbol data in a table read location & call them when I want & make a shift up to make it move up.

That's my plan.
Just because they are moving doesn't mean you have to have them in RAM, in either case you simply index the memory at different points to create the movement.

Or choose a PIC with larger RAM, many of the newer enhanced 14bit devices have reasonable amounts of RAM, and of course CLC - the 16F18446 I'm currently using has 2K of RAM and 16K of ROM.
 

Pommie

Well-Known Member
Most Helpful Member
You could use a palette held in flash and have 256 colours therefore requiring just 256 bytes. Or, use a bigger chip, the 16F18326 has 28k flash and 2k ram.

There is also the old method called 332 which has 3 bits for Red, 3 for Green and 2 for Blue - you'll be surprised how good pictures converted to 332 look.

If you use 8 I/O lines then you can prepare one line at a time and can further reduce your buffer size.

Mike.
Nigel, the 446 also has 28k flash but more I/O.
 

ronsimpson

Well-Known Member
Most Helpful Member
I think you have a very small RAM and you can not make a copy of every pixel in RAM. 8x32x3=RAM 8=up/down, 32=left/right, 3=RGB colors.
So we must make a trade. RAM verses CPU time.
In ROM draw the up arrow. Not in color but in black & white where 1=on, 0=off. binary, below is a simple 8x4 and you need 8x8.
00010000
00111000
01010100
10010010
The code:
You need a byte to say what character. (points to above table in ROM). 0=up, 1=down, 3=left, 4=right, 5="A", 6=B..........
You need three bytes to say what color is the character. 255,127, 64 = Red=full on, Green=50%, Blue=25% (if ROM bit=1 output 255,127,64 if ROM=0 output 0,0,0)
You need one byte to say how much the character is moved up. 0=not moved up, 1=draw character moved up one line. 2=two lines. This number is what line in the ROM table is drawn first.
------------
Sorry my words are not clear. I am saying start with a small ROM table, next code, then to the display. Do not store "pixels" in RAM. Almost no data is in RAM. This should save 768 bytes of RAM.
 
Last edited:

rjenkinsgb

Well-Known Member
Most Helpful Member
Or, use a bigger chip, the 16F18326 has 28k flash and 2k ram
Or use an even bigger chip - our basic one for most things now is a DSPIC33EP256MC502

That's a modern PIC - they cost about £3 / $4 or so, but have 256K flash memory, 32K Bytes RAM and loads of built-in peripherals.
(And they are fast - 120MHz internal clock, 60MHz instruction rate).
https://uk.rs-online.com/web/p/digital-signal-processors/8237792/

There are a few other pin-compatible ones to that with different memory sizes and different peripheral sets.
http://ww1.microchip.com/downloads/en/DeviceDoc/70000657H.pdf

They make running things like graphics LCDs (or such as your LED array) far simpler and easier.
 

Pommie

Well-Known Member
Most Helpful Member
Or use an even bigger chip - our basic one for most things now is a DSPIC33EP256MC502

That's a modern PIC - they cost about £3 / $4 or so, but have 256K flash memory, 32K Bytes RAM and loads of built-in peripherals.
(And they are fast - 120MHz internal clock, 60MHz instruction rate).
https://uk.rs-online.com/web/p/digital-signal-processors/8237792/

There are a few other pin-compatible ones to that with different memory sizes and different peripheral sets.
http://ww1.microchip.com/downloads/en/DeviceDoc/70000657H.pdf

They make running things like graphics LCDs (or such as your LED array) far simpler and easier.
Unfortunately, some of the posters here don't have easy access to the more powerful chips. I think Suraj is more comfortable with the 16 series chips (and asm) which is why I didn't even suggest 18 series (or C).

Mike.
 

Pommie

Well-Known Member
Most Helpful Member
16384 is 16k. I.E. 16x1024. Or 2^14. None of the latest base 10 nonsense.

Mike.
 

Suraj143

Active Member
HI

Thanks for the inputs.I need to build something like this. Its not a charachter display but it is a pattern display See the video.

Here how I'm going to assign 256 RAM locations.

Every pattern I feed from a Table Read & it will load from the bottom row.Before loading the bottom row I have to make shift UP the RAM bytes (Row wise Shift Up) & place the new values in the bottom row.

See the attached picture,I think now you got a clear idea what I really doing :)
 
Last edited:

ronsimpson

Well-Known Member
Most Helpful Member
Here how I'm going to assign 256 RAM locations.
You have one byte/LED but the LED needs three bytes. So you will need to add a little code.
1) One simple option is to have the RAM work like this: RRGGBBxx and the data to the LED is: RR000000,GG000000,BB000000 that only gives you 64 colors.
2) RAM=RRRGGBBB LED=RRR00000,GG000000,BBB00000 that gives you 256 colors.
3) RAM.8bit--->look up table--->LED.24bit you get to use 256 colors out of 2^24 colors.
 

Suraj143

Active Member
Just because they are moving doesn't mean you have to have them in RAM, in either case you simply index the memory at different points to create the movement.

Or choose a PIC with larger RAM, many of the newer enhanced 14bit devices have reasonable amounts of RAM, and of course CLC - the 16F18446 I'm currently using has 2K of RAM and 16K of ROM.
Hi Nigel
MPLAB 8.92 does not support newer PICs. So I installed MPLABX.Its totally a rubish.The old MPLAB8X is very straightforward not like the 8X.

What IDE you use & the language to program the newer PICs?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Hi Nigel
MPLAB 8.92 does not support newer PICs. So I installed MPLABX.Its totally a rubish.The old MPLAB8X is very straightforward not like the 8X.

What IDE you use & the language to program the newer PICs?
I use MPLABX and XC8, once you get used to X it's actually better than the old MPLAB.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top