Can you give us more details about what it is you're doing here? Are you driving NTSC or VGA display? I'm assuming a VGA, since that is substantially easier to drive.
Yes, I'm driving a VGA signal.
What clock speed are you driving the PIC at?
40MHz (actually 10MHz in the PLL mode). On the PIC, that is 10 MIPS.
In this circuit, does the data in SRAM get read by the PIC, then serialized to the video device, or does the PIC present the SRAM with an address, and the SRAM direct-feeds the video DACs?
The latter. The PIC isn't fast enough to move data around. However, it should be fast enough to increment the memory location. Hopefully that is not a fatal assumption. (I have no training in the field what-so-ever.)
Congrats on the 240 pixel resolution. If you could only get that up to 256, then you can get an even 32 or 40 characters on the screen, and can compete with the TI9918 VDP chip (used in a number of home computers and game consoles back in the 80s -- was pretty well received).
Thanks! The memory layout would support 256 horizontal pixels, but if I stay honest with the timing, I only get 251 instructions for the display piece. Because of some setup and restore time, that eats into the display time a bit too.
But I'm curious as to why you only have 100 vertical lines? What is preventing you from achieving the full 400? (BTW, VGA monitors display 480 lines vertically, not 400; therefore, might it make more sense to display 120 lines instead of 100?).
My initial response is that I've just got one 32Kx8 SRAM chip. I'm using the lower 8 bits for the horizontal address and the upper 7 bits for the vertical address. 100 lines simply divides nicely, that's all. I should be able to do 128 vertical - or 256 vertical if I use two chips (or a bigger RAM chip).
I did forget about the 480 vertical. I'll have to check that out! IIRC, the timings change a little bit - but mostly the vertical sync pulse. If so, I think that's a great idea - thanks!
An input of 2 lines? What two lines? How does it expand to 4 lines? I'm confused.
Sorry about that...
In version one, I had two pixels per byte. That was 4 bits per pixel. I was going to map it as XRGB for the four bits. "X" was going to be a pallette select that applied to all color bits. Thus, the pixels were really XR, XG, and XB. That was the 2 lines of input for red, green, and blue.
In version two, I'm using a full byte. Primarily because I don't know how to swap the byte or bit using hardware. (Well, and the chip count stays at two.) Anyway, I end up with something like XYRRGGBB in the byte. This could map out in a similar fasion - XYRR, XYGG, and XYBB giving 4 bits of color resolution to each color. That's the 4 lines on input for red, green, blue.
A common problem amongst digital electronics engineers is they lose site of their analog circuit background.
I would recommend the Art of Electronics, by Horowitz and Hill. It's an expensive book, but it's extremely invaluable. It's like two semesters of analog electronics trapped between the covers of a book. Well worth the money.
... or they just don't have any background!
I think I've seen this book, and it's only 1000 pages!

In reality, I do need something like this. I'll check it out.