Running GCC VGA Demo on ASC+ Board
Lombard
Posts: 30
I'm trying to get the VGA functionality to work on my propeller eval board (ASC+) in pure C. One demo I see using VGA that seems to use no PASM libraries is "pong" (from PropGCC demos), so I set out to make the seemingly simple code modifications to get it running on my hardware.
I changed the #define PINGROUP to 0, as I have my VGA SIP Adapter connected on pingroup 7..0, which is the only contiguous group of pins as specified in the VGroup section of _VCFG.
The VCFG register is set thusly:
I went and investigated how the PLLA is set, which is
So I've sort of reached the extent of my abilities in troubleshooting this. I don't see anything blatantly wrong, but I also don't understand everything I see. Could someone point out what other things are likely to need attention in porting the Pong demo to the ASC board?
I changed the #define PINGROUP to 0, as I have my VGA SIP Adapter connected on pingroup 7..0, which is the only contiguous group of pins as specified in the VGroup section of _VCFG.
The VCFG register is set thusly:
_VCFG = 0x300000FF | (PINGROUP<<9); //where PINGROUP is 0Resulting in a value of 0x300000FF ... VMode will be 0x01, the PLLA is expected to come from cog 0, VGroup is 7..0, and finally, FF for VGA mode. Beautiful! (as far as I can tell)
I went and investigated how the PLLA is set, which is
_CTRA = (0xD << 23);CTRMODE (MSB of 0xD) becomes 0b00001, PLL internal, video mode, looks good to me. And PLLDIV becomes 0b101, so the PLL is going to end up being VCO/4 - I suppose I trust the author of this software, it sounds great to me.
So I've sort of reached the extent of my abilities in troubleshooting this. I don't see anything blatantly wrong, but I also don't understand everything I see. Could someone point out what other things are likely to need attention in porting the Pong demo to the ASC board?
Comments
Do you see any LED response?
The Propeller video is set up for 3.3volt resistor ladders to provide the correct video output.
You can by-pass the resistors as suggested, but then your next Arduino shield might damage the board by providing 5VDC directly to the Propeller i/o.
It is up to you, but be careful with changing the PropellerASC+ and what you might desire in the future. There are better boards for studying video output of the Propeller in C, or Spin. Even a 40pin DIP Propeller might be a wiser choice.
IMO, save the PropellerASC+ for your Arduino shields.
And Kuroneko, to connect the VGA SIP to the ASC board I had to create a funky ribbon cable with a header for the i/o pins, and two long flying leads for 3.3V and ground.
You can also get this which is an easy to assemble, all through-hole kit that provides VGA and stacks on top of the ASC without blocking the arduino pins.
I have a DE-15 with a valid resistor ladder, that is connected to a pingroup that is also set in the VCFG register. Are there any other hardware considerations I need to make? I'm starting to think the issue is with this part of the video initialization routine, that is, setting up the Counter A frequency:
Could someone point me to somewhere I can read what the rationale is behind why the FRQA is being set this way? Is there anything about this code that is hardware-dependent?
I don't have full confidence in using spin/bst(c,l), so there's the command I used, in case there may be other problems.
But the result is nil, I see no LED's on the VGA SIP adapter. :?
When this works we can have a look at pong (in case it still doesn't work).
Does something like this work: Did you ever manage to run anything on the ASC+?
The code you posted, if I slow it down with a
Counts in a somewhat binary-like fashion, although the numbers are not valid binary (once it gets past 4, the numbers are actually wrong). The led's stop lighting up entirely after the 15th "count," at which point the led's are displaying 0b11000000, then they all go off for good.
The way the counting takes place is very odd. I verified all of the led's with this code as well:
Not quite sure what I needed to use >> instead of <<, since we're taking 0b0000001, and turning it into 0b0000010, 0b0000100, etc.
But this code will light V, then H, then B0 (...), all the way up, in order.
So if single LEDs work why doesn't the counter (outa[7..0]++) work properly (regardless of bit order)?
Can you just light all of them (to eliminate a power issue):
Setting the PLL for 80MHz (I'm going to post the code below, it may be wrong) doesn't change the behavior.
re: USB power, I use a QuickStart with human interface board (that's 16+2 LEDs) powered from USB and don't have any issues here (VGA work). Not sure what else to suggest except using a power supply (to eliminate a weak USB connection).
You could also run some I'm-alive code over serial and keep all cogs busy (this gives you about 60~80mA). If that's too much I'd expect some effect on the former.
Also, if I poke the solder joint on the adapter with a piece of loose wire for either H or V, (while in sitting in indefinite waitpne) the corresponding led will light. This does not work for the other ones. There's no intermittence in the connection, so I'm not sure what's causing that, but there seems to be some electrical problems on the adapter for sure.