|
Post by Jeff Ledger on Mar 27, 2007 10:54:35 GMT -5
I posted this in c.s.c, but I'm a bit more hopeful for a better answer here. I need an additional bit or two for my own C=VGA project, (Need some larger numbers. ) It appears that I could use the Cassette port, perhaps the motor control line, at BIT 5, (0=ON 1=OFF) but I can't seem to find the address in the Commodore Reference for it's control. Looking at 220-221, it seems to be omitted, or perhaps I'm not seeing it correctly. Can someone give me a POKEable address for toggling this bit? Or even a couple in this neighborhood? Thanks Oldbitcollector
|
|
|
Post by tlr on Mar 27, 2007 12:00:02 GMT -5
It appears that I could use the Cassette port, perhaps the motor control line, at BIT 5, (0=ON 1=OFF) but I can't seem to find the address in the Commodore Reference for it's control. Looking at 220-221, it seems to be omitted, or perhaps I'm not seeing it correctly. Can someone give me a POKEable address for toggling this bit? Or even a couple in this neighborhood? 1. I'm not sure if the interrupt routine will disable it though. I can't test in vice because it doesn't show if the motor is running.
|
|
|
Post by Robin Harbron on Mar 27, 2007 12:23:08 GMT -5
It appears that I could use the Cassette port, perhaps the motor control line, at BIT 5, (0=ON 1=OFF) but I can't seem to find the address in the Commodore Reference for it's control. Looking at 220-221, it seems to be omitted, or perhaps I'm not seeing it correctly. Did you mean pages 320-321 in the PRG? If so, yeah, it's on page 320. Location $0001 like tlr said. Just be careful to treat the other bits in that register with respect
|
|
|
Post by MadModder on Mar 27, 2007 12:53:52 GMT -5
How many bits are you using in the user port? The serial handshaking bits must be possible to change somehow... Maybe address 659, control register rs232... Hmm, perhaps not. 56576 controls data direction, and 56577 the bits. I wonder if one can set all bits to output, and have 8 more bits to play with. But it seems RS232-in is at another address, and cannot be set to output. Oh well... This I just have to test if it works. 15 bits output from the user port, yay!
|
|
|
Post by Jeff Ledger on Mar 27, 2007 13:43:33 GMT -5
It appears that I could use the Cassette port, perhaps the motor control line, at BIT 5, (0=ON 1=OFF) but I can't seem to find the address in the Commodore Reference for it's control. Looking at 220-221, it seems to be omitted, or perhaps I'm not seeing it correctly. Did you mean pages 320-321 in the PRG? If so, yeah, it's on page 320. Location $0001 like tlr said. Just be careful to treat the other bits in that register with respect So it would be POKE 1,(1/0)? or POKE 5,(1/0) I don't see any decimal notation, and addressing has always been a weak point for me with this stuff. Jeff BTW: MM: If you can pull 15 output bits off the userport, you will make my week! Heck, I'd settle for 10!
|
|
|
Post by tlr on Mar 27, 2007 14:04:07 GMT -5
Did you mean pages 320-321 in the PRG? If so, yeah, it's on page 320. Location $0001 like tlr said. Just be careful to treat the other bits in that register with respect So it would be POKE 1,(1/0)? or POKE 5,(1/0) I don't see any decimal notation, and addressing has always been a weak point for me with this stuff. I posted in decimal. For normal basic operation: POKE1,55 POKE1,119 (This is the normal $01 value of $37 with bit 5 set to 0 and 1 respectively.) EDIT: I checked the IRQ routine, and it resets $01, so you'll need to disable interrupts or modify the routine. If you disable IRQ, the keyboard will no longer work. In ml all this is more straightforward,
|
|
|
Post by tlr on Mar 27, 2007 15:25:09 GMT -5
Actually my pokes were all wrong. The were for bit 6... silly me. However I have made a cooler solution... Initialize:10 FORI=820TO905:POKEI,PEEK(59133+I):NEXT:POKE869,190:POKE190,16 20 POKE788,52:POKE789,3 Start motor:POKE190,0 Stop motor:POKE190,16 Restore normal operation:POKE789,234:POKE788,49 Note: The order of the 788/789 pokes is important. Tech: Copies the IRQ routine from $ea31-$ea86 down to $0334-$0389 and patches the play button check to read $8E instead of $01. Changing the IRQ vector without disabling interrupt is dangerous because an interrupt might occur when we only wrote the first half of the vector. Trick: We put our new routine on an address who's low byte is safe even in the original interrupt routine. Setting the LSB to $34 (of $0334) will first result in $ea34 which still works fine but just skips the jiffy clock update. The next step sets the MSB to $03 resulting in $0334, done! Resetting it must be done in reverse, i.e first the MSB to $ea resulting in $ea34. Then the LSB to $31 resulting in $ea31.
|
|
|
Post by David Murray on Mar 27, 2007 19:04:29 GMT -5
What are you trying to do, anyway? What are you going to use 15 bits for, exactly? You said C=VGA.. That is kind of scary, almost like you are trying to generate a VGA signal from the user-port or something.. I wouldn't have even thought the C64 fast enough for that.. so you've got me curious here.
|
|
|
Post by Jeff Ledger on Mar 27, 2007 19:54:49 GMT -5
Yes, you are correct, the userport is far too slow to generate the sync for VGA, but the propeller chip isn't. I'm using some propeller (spin) code to handle the VGA routines as well as a lookup table for my own version of a userport bus. So on the 64, I designate a POKE 56579,255 to set all the userport lines to output, then I send a specific byte of data to determine the specific command on the propeller side, from clear screen, to set a variable. This doesn't allow complex graphics at this point (too slow), but vector graphics are possible, as well as movement. Current code example might look like this.. 10 POKE 56579,255 :REM SET ALL BITS FOR OUTPUT 20 POKE 56577,7 : REM CLEAR SCREEN 30 V=56577 50 POKE V,11:POKE V,20 : REM SET VAR1 TO 20 60 POKE V,12:POKE V,100: REM SET VAR2 TO 100 70 POKE V,2 : REM PLOT (VAR1,VAR2) Add some joystick detection, and some math, and you've got some neat vector control of the VGA monitor on the 64. I've got BOX,FILL,CHARACTER,PEN ON,PEN OFF, and limited color. Here becomes the problem, I needed a toggle bit to tell the propeller to accept a new byte of information because all communication is currently one direction. (That will have to change when I start working on the SD/MMC interface to the commodore) Currently, I'm using the 8th bit, but that limits me to 128 digits in a tick. (Works, but not ideal) If I use something else, (a ninth) I can get my 255 bits back and plot x,y on most of the screen in one pass. Considering all the C=VGA projects so far have been vaporware, I consider this frail success, ... a success. Jeff
|
|
|
Post by Jeff Ledger on Mar 27, 2007 21:30:23 GMT -5
The cassette code works perfectly! Yup there's my toggle. Interesting, I had to add a little more resistance to that line to get it closer to 3.3v than I did the userport lines... Strange..
Jeff
Update:
The cassette motor line appears to have a slower power fall-off than the userport as well, requiring a small load to bring the line low quickly. A 3v LED did the trick perfectly. (pretty blinken lights) I'll have to look at the schematic when I have a chance and see if there's a cap somewhere near there.
|
|
|
Post by Robin Harbron on Mar 27, 2007 22:00:16 GMT -5
The cassette code works perfectly! Yup there's my toggle. Cool So, what would the 10th bit be useful for, if you had it?
|
|
|
Post by Jeff Ledger on Mar 27, 2007 22:29:57 GMT -5
Hmmm. Just what would I do with 255 more digits? Heh. As soon as I get the spin code to accept the 9th bit, I'll let you know.. Jeff
|
|
|
Post by MadModder on Mar 31, 2007 7:53:04 GMT -5
The pinout information on the CIA-circuit, tells me that user port pin 8 (PC2, pin 18 on CIA) puts out a LOW pulse everytime something is written to port B (the 8 standard user port bits). That should be possible to use as a "read new byte"-signal. Try it. And the serial bits are unfortunately mostly the same as port B. Maybe PA2 and ATN works. I'll have a look at that.
|
|
|
Post by MadModder on Apr 1, 2007 8:40:53 GMT -5
I was right. PC2 does put out a LOW signal everytime PORT B is written to. It is a very short pulse, so it can't be seen by eyes, but my multimeter shure got it. PA2 and ATN is easy to set. ATN is inverted though. POKE56578,PEEK(56578)OR12 to make shure PA2 and ATN is set to outputs. POKE56579,255 to make PB0-7 set to outputs. then you have to work with the PA bits first POKE56576,PEEK(56576)ANDNOT4 to clear PA2 POKE56576,PEEK(56576)OR4 to set PA2 POKE56576,PEEK(56576)OR8 to clear ATN POKE56576,PEEK(56576)ANDNOT8 to set ATN then set the PB bits on 56577, and voila! You get a low pulse on PC2, and you can read your 10 bits of information. And ofcourse, a video clip madmodders.se/temp/C64/userport_11_bits.avi (DivX 6.5.0, 2.1MB) Yellow is PC2, reds are ATN and PA2, greens are PB7 to PB0 BTW, Jeff, is your week made now? ;D [edit] I'm trying to figure out how to output bits at will in a static mode on SP1 and SP2. They're serial in/out from 8-bit shift registers. That'd be sweet if it works. 2 more bits. Now I have something (more) to do during easter... ;D
|
|
|
Post by MadModder on Apr 5, 2007 18:31:20 GMT -5
Okay, 2 more bits to play with. It's the SP1 and SP2 signals. Quite simple. Flip them between inputs and outputs. SP1: low: POKE56334,PEEK(56334)OR64high: POKE56334,PEEK(56334)ANDNOT64SP2: low: POKE56590,PEEK(56590)OR64high: POKE56590,PEEK(56590)ANDNOT64How about that. 12 bits and one toggle. And I found something else too. When setting the CIA timer A settings to output and making it count system cycles instead of pulses on the CNT pin (a value of 65), and you then poke a byte into the serial shift register, the bits are automatically sent out on the serial out pin, and the CNT pin is putting out the clock count. Very neat if you want serial comunication instead.
|
|