The 16f57/16f59 are the same as 16f54, but have 2K FLASH, as well larger RAM.
There are no pheripherals to configure.
However, using assembler, this is too difficult, since the RAM is banked into 16 byte pieces,
as well there are only 2 stack levels. I wrote one text scroller for the 16f1824 in assembler.
I tried to use Hitech C for the 16f59 however it can not use string pointers at all.
XC8 can do it, but it can not dereference 2-level string tables.
So a construct like the following is neccessary:
- CODE: SELECT_ALL_CODE
char* get_font_ptr(char* font)
{unsigned int addr;
addr=*(font+1);addr<<=8;addr|=*(font);
return(((const char*)(addr)));
}
The LED matrix is 10x5 LEDs connected directly to the PIC I/O with no resistors whatshowever.
It can work at 3 volts easily. Frequency is 560 KHz.
To simplify the scrolling algorithm, a 2K SRAM chip is used (one 256 bytes bank is addressable).
Since proportional fonts are used, it is very complicated to fetch bitmap data by scroll position.
So it is precomputed and stored into RAM.
I made the scrolling message working within a few days. There was some program space left,
so I added I2C code, and removed some unneccessary code. It can read data from a temperature sensor,
and insert it into the scrolling text!
After this program memory was used up 92%. Doing some optimizations, I was able to reduce it to 81%.
So there is still a little room for instance to change the 2K parallel RAM to serial RAM.
Anyway, I have some of these 2K RAM chips around here, and there is little opportunity to use them ever.
If anyone is seriously interested in the source code, I can publish it here.
The schematic does not exist but it is not much to documentate.
It should be possible to rebuild it, simply using the information inside the source code
for pin assignments.
1. The I2C code does not contain any delays, it simply relies on the low clock frequency (instruction cycle is 141.6 KHz).
2. The program is not using all of the RAM, only 44%, so it might even be possible to run it on the 16F57.
3. Not all of the ASCII subset is implemented, only capitalized letters, numbers, and a few symbols. However,
each additional character only needs 5 program words.
4. There are various flickering effects due to the low frequency. Eventually, this could be changed to 1Mhz or 2 MHz.
If 4 MHz are used (or 3.58 MHz colorburst), it might be neccessary to add delays to the I2C code.
If anyone is interested to rebuild this, maybe a PRO compiler can be used, and a serial RAM. How much codespace can be saved using a PRO compiler? I don't think so much but certainly some 100 words.
The bill of materials is about 5 dollars, depends what LEDs you use, what kind of PCB, etc., so it could be $10 if you use expensive LEDs. Any kind of LEDs can be used. They are simply connected in X/Y fashion with common cathode. On the proto PCB two anodes are connected to each other this is the only way to get a dense layout.
The I2C temp. sensor is a MCP9802 I think. But having temp. display is optional. It would also be easy to use a pushbutton to skip between different messages.
http://www.youtube.com/watch?v=VC9MHTGvSWo
Some source code pieces are here on my blog: http://forum.allaboutcircuits.com/blog.php?u=164830
However the complete source code was not yet made available to the general public.
Observing various projects here, including larger source codes as well, I don't see a problem making it available.
I will do it if it is requested.