Accessing Beagle XM I/O expansion pins from Basic
Tank (53) 375 posts |
OK, GPIO_LoadConfig and GPIO_SaveConfig added. |
Andrew Conroy (370) 740 posts |
Thanks for all your work on this, I too now have a bank of flashing LEDs plugged into my BB :-) Planning on maybe making a little PCB that will bring the (level translated to 3.3/5V) GPIO lines from the expansion connector out to a header, and give me a (level translated too) I2C port too. Just a thought – it might be helpful if interactive help would tell you the GPIO number of the pin you were hovering over? |
Tank (53) 375 posts |
The only level translator (bi-directional without control) IC’s I could find were Farnell 1702548 but they are TSSOP package… Very tiny!! Andrew, [grin] Feel free to add the help to the RES file [/grin] For info, The Expansion port on powerup is setup as follows. |
Peter van der Vos (95) 115 posts |
Good work. What you already did is enough to use the GPIO line on the BeagleBoard but:
Wouldn’t it be more convenient to drop the file on the Test Program window? |
Tank (53) 375 posts |
Peter, the test program is just that, and was mainly for my own use and was a quick and dirty product. What might be appropriate now is a setup program (that would be registered !) that could setup the GPIO pins as a user might need them and then save the file (with a registered filetype !) |
Andrew Conroy (370) 740 posts |
Yes, those were the only ones I could find too! It will be interesting soldering them up to a convertor board!
I will try and get them added, but no promises for when just yet though! Quick question, probably showing my ignorance here – when you use GPIO_WriteExp32, how do you get a 32bit wide write when you’ve only got 22 GPIO lines to write to? |
Tank (53) 375 posts |
The writexxx32 SWI’s use a mask to only write to the pins that are available within the 32 bits. So even if you try to write &FFFFFFFF only the masked pins will actually be written.This was added to allow faster setting of multiple pins. The !SWIsDetail file in the source lists the GPIO pins affected. I have also now started to write a program for creating the config file. I have added the help values to that program, so unless you use the test program a lot, it may be pointless. Request for app name and filetype sent. |
Andrew Conroy (370) 740 posts |
That’s what I thought was happening. So we can do 18bit wide read/writes per call in reality. |
Tank (53) 375 posts |
Yes, the SWI’s can actually access the following in one operation, |
Neil Fazakerley (464) 124 posts |
I’m using some level translator boards sourced via eBay US, based on the Maxim MAX3002 chip. Ebay item number 200418656111. They’re more expensive than the Farnell part but they do come pre-mounted on a pcb with 0.1" dil pin sets included so they’re a lot less fiddly to deal with and can be popped straight onto proto-boards for quick I/O port tests. The postage is £5.50 but, as there’s no extra shipping charge for any number of boards, I ordered four to cover extra ports and keep the cost per channel down. Allow a week or two for delivery though. |
Trevor Johnson (329) 1645 posts |
Looks fun!
|
Tank (53) 375 posts |
New download available now with the first version of the configuration program in. |
Bryan Hogan (339) 592 posts |
Ooo, ooo, please someone wire up the GPIO pins to the light on the front of the ARMini so that it pulses back and forth like Knight Rider :-) |
Tank (53) 375 posts |
Finally got all my level shifters and LED drivers wired up. I’m now looking at a line of 45 LED’s running in sequence!! |
Tank (53) 375 posts |
OK, 45 LED’s running in sequence 6 input lines reading buttons state AND I2C reading the temperature !!! (Currently 18 degrees). (Doh… &18 degrees so 24 in real life) |
Trevor Johnson (329) 1645 posts |
In typical off-topic red herring style, has anyone investigated the Khepera III (PIC microcontroller) with KoreBot II (XSCALE PXA-270)? In my naivety, I’m wondering whether the robot could be controlled natively from RISC OS… although the apparent lack of a video connector would complicate things :-( [Edit: Some of the K-Team founders at EPFL are aware of the A310 and RiscPC at the Musée Bolo. Also, a further ref which may be of interest.] |
Tank (53) 375 posts |
Right , my first practical use of the GPIO interface…. |
Trevor Johnson (329) 1645 posts |
More robot stuff. [Edit: And a GPIO video.] [Edit2: What’s the point of a blog which doesn’t accept comments? And the YouTube version doesn’t seem to accept URLs either!] |
Tank (53) 375 posts |
A new version of the GPIO module available for download. So far I have used the GPIO interface to test 3 PCB types and 4 wiring loom check programs. |
Trevor Johnson (329) 1645 posts |
(Off topic) What are the chances1 of a RISC OS program solving a Rubik’s Cube in less than 4.762 seconds, using an -A9 device? 1 If it’s able to work with a camera-equipped tablet and Bluetooth. |
Dave Higton (281) 668 posts |
Tank: I haven’t used your software yet, but I hope I will get to play in the not too distant future. One of my home projects is to replace the A3010 with a BeagleBoard as my central heating controller. It will have to control an LCD module, which means I’m going to have to generate strobe pulses of maybe 1 microsecond (ish) duration. It’s silicon from several generations ago. Are there things to be aware of when trying to change the state of a pin twice in a short time? Any suggestions as to the best way of determining a minimum pulse duration? (The application is in BASIC, and I’m not averse to a FOR..NEXT loop, if that’s the simplest solution.) Does anyone think that the ability to generate a pulse would be a useful addition to Tank’s module? |
Trevor Johnson (329) 1645 posts |
Tank, there’s an amount of info available already, although not much good yet without a board or available ROM build! 1, 2 |
Martin Hansen (393) 56 posts |
For Info: |
Tank (53) 375 posts |
Dave, there’s no problem accessing the pin quickly, but at 1 millisecond you would hardly need a delay loop !! Trevor, Yes, I have seen this info, and I have asked for more information in the RPi forums. For the module to work, I need to know the control register address and the actual GPIO numbers (it seems strange that the available GPIO’s are numbered 0 upwards). |
Dave Higton (281) 668 posts |
1 microsecond, actually… |