Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:21 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Bashing the Metal.

Author Message
YT2095

Newbie

Joined: 07/02/2012
Location: United Kingdom
Posts: 22
Posted: 02:50pm 12 Feb 2012
Copy link to clipboard 
Print this post

I`m wondering if there`s anyway to directly "bash the metal" in DM/MM basic at all for the GPIOs.

Setpin and related commands are great! but they need to be done sequentially, and I can`t see a way to set a load of pins all the same time as is required by some peripheral ICs.

something like DDRD, PortD as used on the arduino, the nearest I can think of would perhaps be POKE statements to the Data Direction Register and such, but I have no I/O map for these?
and every time I try POKE I get an error trapped and the board resets (hangs head in shame).

it would be really handy for me to have this information as it would save me a GPIO pin as a control line that I would need to use when I know the data lines are stable, that single line I`m forced to use as Control, is the difference between 2 and 4K for an EPROM programmer for instance.

a Poke Map anyone?

Cheers each ;)


 
mookster1
Regular Member

Joined: 10/06/2011
Location: New Zealand
Posts: 81
Posted: 08:44pm 12 Feb 2012
Copy link to clipboard 
Print this post

Maybe as an aside, you could implement something in hardware? Like have AND gates with one input on the Maximite output pin and another that is pulled high when you want to activate all the pins together? (this line is shared on all of the AND gates so if you wanted 8 pins you'd have 8 AND gates, if that makes any sense?) It would be a great feature to have in software, though.
Capacitance is futile - roll on 2012!
 
YT2095

Newbie

Joined: 07/02/2012
Location: United Kingdom
Posts: 22
Posted: 09:07pm 12 Feb 2012
Copy link to clipboard 
Print this post

yeah, I`de just use a 74244 or 245 for that anyway, you get 8 of them in a single package, or a 74374 if I wanted the outputs latched.
but you still need an extra pin to OE or LE.

 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 05:28am 13 Feb 2012
Copy link to clipboard 
Print this post

Exactly what chip needs ALL the bits set at the exact same time.

When using the setpin command each pin will retain the Digital state set.
So if for example you require (d1) --> (d8) to be set to a total value of 11111111
for x = 1 to 8 : setpin(x),8 : setpin x , 1 : next x
will set the 8 pins to digital output and set the binary value on each pin to a 1

That value will stay on the pin until either the PIn mode is changed or pin value is set to a different value.

Once all the pins have been set, the Peripheral chip can then read the value by pulsing/setting the Enable/CS or similar pin.

Edited by djuqa 2012-02-14
VK4MU MicroController Units

 
YT2095

Newbie

Joined: 07/02/2012
Location: United Kingdom
Posts: 22
Posted: 10:28am 13 Feb 2012
Copy link to clipboard 
Print this post

if I wanted to put an 8 bit D to A one one of the ports to output a sqr wave, I don`t I don`t want to have to cycle through all the numbers just to get 255 out and the reverse to get back to 0.
it would no longer be a sqr wave, but rather something akin to a triangle wave!
there are other instances also, such as 4 to 16 decoders for chip select etc...
That`s why I need to present the required number in one single shot, it Is important/critical for quite a few applications, esp when dealing with several MHz equipment.


 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024