PDA

View Full Version : PORTA Logic - Be the processor



Darrel Taylor
- 16th December 2008, 20:28
<script type="text/javascript" src="http://www.pbpgroup.com/files/PORTA/swfobject.js"></script><div id="id12647"> Loading Flash movie...</div><script type="text/javascript">var so12647 = new SWFObject("http://www.pbpgroup.com/files/PORTA/PORTA.swf", "movie12647", "800", "800", "6", "#FFFFFF");so12647.addParam("loop", "true");so12647.write("id12647");</script>

If it's too big to fit your screen, try this link, which will resize itself to the browser.
It also let's you Zoom and Pan, in case you're tired eyes need a little help. :)
http://www.pbpgroup.com/files/PORTA/PORTA.swf

Darrel Taylor
- 26th January 2009, 04:01
OK well, as a game ... it's pretty "Lame".
But the idea was to also pass on the way a PORT works.

Surely someone has a comment on PORTA.
"It Sucks" is a perfectly viable response.
Other responses may apply.

I'm just trying to see if I can "communicate" with Flash.
My brain (what little is left) thinks more graphically than verbally.
Sometimes I have a hard time getting my point across with words.

Flash may give me that ability, but I'll never know if nobody says ...

"Oh, I get it now", or the other possibility ... "HUH!".
<br>

mackrackit
- 26th January 2009, 07:44
It is pretty realistic. I fried several PICs using flash just like I do on the bench :D

What would be nice would be a "I give up, show me" button. Or does that pop up if I fry enough?

T.Jackson
- 26th January 2009, 09:58
Not bad to you too Darrel.

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3149&stc=1&d=1232963807" >

God damnit ....

I'm Tafe qualified in Digital Electronics :P

Nice job mate, very impressive


Trent Jackson

T.Jackson
- 26th January 2009, 11:19
Arh! the results of second attempts. I'm rusty as hell.

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3150&stc=1&d=1232968586" >

I strongly encourage you to further this Darrel

Trent Jackson

rhino
- 26th January 2009, 23:08
Very cool Darrel. Have you ever thought about marketing this type of approach as a tutorial series? Food for thought.

T.Jackson
- 27th January 2009, 00:50
I had plans, many years ago, to do something like this, but with a bit of a twist. A complete digital electronics training / development system, half virtual (like what you have done here) -- and half "real". The real part would have plugged into your parallel port (of course today though you'd go with USB) -- and allowed the user to setup the circuits on it, just as they see it on their screen. The virtual side would check the circuit and spit out exercises to complete.

I actually presented the idea to Silicon Chip. They thought it sucked harder than a heated vacuum cleaner..

Trent Jackson

mister_e
- 27th January 2009, 01:20
http://www.falstad.com/circuit/e-index.html

T.Jackson
- 27th January 2009, 01:54
Getting distracted, starting to think about bullet proof vests again.

mackrackit
- 27th January 2009, 02:10
Getting distracted, starting to think about bullet proof vests again.
I have one with a hole in it you are more than welcome to use. :p

T.Jackson
- 27th January 2009, 02:41
I have one with a hole in it you are more than welcome to use.

I hope it is a level IIIa type, because otherwise they're going to be sweating and shaking all over the place. Only the IIIa will protect against 0.44 caliber.

<img src="http://imagehost.vendio.com/a/32019732/aview/bullet1.jpg" >

Trent Jackson

Darrel Taylor
- 27th January 2009, 02:49
I have one with a hole in it you are more than welcome to use. :p
Oh yeah ... I want one of those ... Not.<hr>
Thanks for trying out the Flash yous guys.

Do you feel like you better understand how a PORT works?

I was thinking of trying Timer2 with the CCP module (without the game).
<br>

T.Jackson
- 27th January 2009, 07:05
You won't be needing a vest Darrel. Too smart, genuine and kewl.

Trent Jackson

mackrackit
- 27th January 2009, 15:04
Do you feel like you better understand how a PORT works?

I learned that I need to learn more. That is why I think a "I give up" option would be good.

Before this I never really gave much thought as to how the guts of a port worked. After I fried two virtual chips with a score of 21 (I got lucky, the questions I got) I figure it is time to dig out the books.

I will come back to take a test.

rhino
- 27th January 2009, 17:19
Do you feel like you better understand how a PORT works?

I was thinking of trying Timer2 with the CCP module (without the game).
<br>

If you're willing to keep writing them, keep 'em coming. Very nice job!

T.Jackson
- 28th January 2009, 02:52
I can't see why Darrel couldn't come up with a complete online, virtual interactive, digital electronics tutorial.

- Start off with discrete mathematics (truth tables, gates and boolean algebra)

- Proceed onto counters, flip-flops etc ...

- Interactive circuits which illustrate all of the gates which are used to build things like 4017 decade counters etc ...


I think that people should really have a baseline understanding of all this before proceeding to deal with microcontrollers.

Trent Jackson

Acetronics2
- 31st January 2009, 14:29
Hi, Trent

I think a person called Pascal MAYEUX already "wrote" this ... ( Pic internal simulation, Quizz and so on ...) "some" years ago ...

May I add It works as a liitle Windows program ???

His book " Learn Pic Programming" is stamped " 2001 " Year at "ETSF" French Editor ...

BTW ... What to win for a 138 result ??? ( proof available @ 235 k Zipped file ...)

Alain

T.Jackson
- 1st February 2009, 01:43
You know what Alain ...

I'm beginning to wonder if I am truly mistaken about you. I could have sworn that you were one of these corrupted, vendetta-driven buddies of mine (Alain Mackie)

Trent Jackson

Bruce
- 1st February 2009, 02:22
Do I get a prize or something?

Darrel Taylor
- 1st February 2009, 05:04
Do I get a prize or something?

Hmmm, I guess being qualified to play with your own "PORT" isn't worth much when you're married. ;)

144 :eek: That's "Gross".
Actually, I don't think I ever got higher than that either. <img src="http://www.picbasic.co.uk/forum/images/icons/icon14.gif" />
And I knew the questions ...
<br>

Bruce
- 1st February 2009, 16:56
I can see a lot of really nifty tutorials with your Flash gadgets. Very cool stuff.

This reminds me of the Microchip eLearning Flash-based training modules. Nice work
DT. P.S. I had a 145 just before this one, but thought I could beat it. Didn't happen...;o}

Darrel Taylor
- 2nd February 2009, 04:01
This reminds me of the Microchip eLearning Flash-based training modules.
Sounds interesting. I'd like to see those.
Can't seem to find them though. Google let me down?


DT. P.S. I had a 145 just before this one, but thought I could beat it. Didn't happen...;o}
Uh huh, suuure you did ...
My next one will impose a 10pt handicap for anyone with Bruce in their username. :D
not

Bruce
- 2nd February 2009, 15:53
Here's the link to Microchips flash training modules; http://techtrain.microchip.com/x14/

Darrel Taylor
- 3rd February 2009, 03:02
Those are pretty interesting.
Gives me a few ideas too.
<br>

MitchStipp2
- 8th March 2009, 02:28
Your game was fun, I got a 109 (better hit the books again)

I have been migrating an application from a 16F887 to a 18F4420. After some debug (few hardware issues - oops!) the two output ports are doing great (B & D). Thanks to you Darrel my Timer 01 interupt is clicking away. I was able to change the config1h register to use the 4x PLL oscillator. But I am having trouble getting my input ports (A & E ) to function (very ashamed ) :confused:
Oddly enough, there is one bit of the A port that works (bit 4). The rest of inputs on port A and E ignore me. Hardware check of pins show normal (pulled to Vdd via resistor with contact closure dragging them to Vss when applied)

Below is the I/O setup from my program:
================================================== ======
' ~~~~~~~~~~~~~~~~~~~ Define A I/O Port and Define Analog I/O ~~~~~~~~~~~~~~~~~~~
PORTA = %00000000 ' clearing bits as recommended in data sheet
ADCON0 = %00000000 ' turn off all A/D
ADCON1 = %00000111 ' turn off all A/D I/O points - make digital
TRISA = %00111111 ' bits 0-5 declared as inputs

' ~~~~~~~~~~~~~~~~~~~ Define B I/O Port ~~~~~~~~~~~~~~~~~~~
TRISB = %00000000 ' bits 0 declared as output


' ~~~~~~~~~~~~~~~~~~~ Define C I/O Port ~~~~~~~~~~~~~~~~~~~
PORTC = %00000000 ' clearing bits as recommended in data sheet
TRISC = %11110000 ' bits 4,5,6,7 defined as inputs
; LATC = %00000000 ' bits 0,1,2,3 declared as output

' ~~~~~~~~~~~~~~~~~~~ Define D I/O Port ~~~~~~~~~~~~~~~~~~~
TRISD = %00000000 ' bits 0-7 declared as output
; LATD = %00000000

' ~~~~~~~~~~~~~~~~~~~ Define E I/O Port ~~~~~~~~~~~~~~~~~~~
PORTE = %00000000 ' clearing bits as recommended in data sheet
TRISE = %00000111 ' bits 0,1,2 declared as inputs
' bits 3-7 declared as output
' to prototype Application inputs
================================================== ======

Does this look as you would expect? Got any other areas you would recommend I check - I think I am close to being able to recite the 18FXX2 data sheet, but it doesn't mean I might be overlooking something.

Bruce
- 8th March 2009, 03:24
Try ADCON1 = %00001111. Deduct 1 point from your score...;o}

MitchStipp2
- 8th March 2009, 04:57
Wow Bruce you are correct! But did I miss an errata sheet or is my trouble reading the table in the attached document
---------------------------------------------------------------------------
In any event I am back in the running. I owe you for this. You can take five of my points and add to your score.

Thanks again

Bruce
- 8th March 2009, 15:49
I'm not sure what to tell you about the MS Word DOC, but here's what's in the 18F4420
datasheet.

MitchStipp2
- 9th March 2009, 18:45
I think I figured it out Bruce

You provided data from Publication - DS39631E
=============================
PIC18F2420/2520/4420/4520
Data Sheet
28/40/44-Pin Enhanced Flash
Microcontrollers with 10-Bit A/D
and nanoWatt Technology
=============================

I was reading from publication - DS39564C (appears an earlier pub)
=================================
PIC18FXX2
Data Sheet
High-Performance, Enhanced Flash
Microcontrollers with 10-Bit A/D
=================================

I don't remember how I got the one I was using, but it is WRONG
concerning the ADCON1 register. I will be ceremonially disposing of the
incorrect publication this evening, it is sure to be festive event.

Once again "garbage in, garbage out".

Thanks again

Bruce
- 9th March 2009, 19:18
That one just covers the 18F242, 252, 442 and 452 series. Always download the one
specific to the PIC you're using. Things change a good deal from one series to the next.

Also check for & download any errata sheets that might be available. These can save you
a LOT of time. Some series may have a problem not listed in the primary datasheet.

The 18Fxx20 series have 5: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010270