TF Services Interfaces and BBC Micro:bit

Nagging hardware related question? Post here!
henry's cat
ROM Dongle
Posts: 9
Joined: Mon Feb 15, 2016 11:51 am

TF Services Interfaces and BBC Micro:bit

Postby henry's cat » Sun Jan 13, 2019 10:28 am

Last year I bought a BBC Micro:bit and have been experimenting with the on-board I2C bus and a T. F. Services I2c Parallel Interface. Using Microsoft MakeCode Blocks I have successfully managed to get the interface working after many years of it standing idle. So far I have just set the outputs and have not tried reading any inputs.

The interface seems to work fine at 3.3V rather than the usual 5V and is powered by the Micro:bit 3.3V.

What I have struggled with is trying to understand how each chip in the interface is addressed. The explanation of the address switches and example in the I2C Interface manual is as clear as mud. I've left all the switches off so that the two port addresses are 56 and 57. Can anyone explain clearly how the setting of the switches affects the address range?


User avatar
Whopper
Brittle Membrane
Posts: 105
Joined: Tue Oct 24, 2017 4:04 pm

Re: TF Services Interfaces and BBC Micro:bit

Postby Whopper » Sun Jan 13, 2019 12:44 pm

I2C addressing is based on the most significant 7 bits of the address byte, thus the addressing range is 0 to 127. So if a devices address is 56(Hex) then the binary byte would be 0101 0110. To READ from this address that is the binary code which is sent to all of the present interfaces. Only the correct interface will respond. To WRITE to the same address you need to set the least significant bit to '1', thus for address 56(Hex) you would send binary 0101 0111.

Google can be very helpful with stuff like this.


Whopper


You woke me for THAT!!!
User avatar
NormanDunbar
Super Gold Card
Posts: 660
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: TF Services Interfaces and BBC Micro:bit

Postby NormanDunbar » Sun Jan 13, 2019 10:20 pm

This is a good introduction to i2c: https://www.best-microcontroller-projec ... orial.html.

This is larger: https://en.m.wikipedia.org/wiki/I2C.

HTH


Cheers,
Norm.


Why do they put lightning conductors on churches?
If at first you don't succeed, don't take up skydiving!
If you think your job is pointless, remember, there's someone in Germany who fits indicators to BMWs.
User avatar
tonyfirshman
ROM Dongle
Posts: 4
Joined: Fri Jan 18, 2019 9:03 am

Re: TF Services Interfaces and BBC Micro:bit

Postby tonyfirshman » Fri Jan 18, 2019 12:06 pm

The question was asking about the address switches, not actually coding data for input/output. All the switches do is set the chip address. This is is seven bits for the chips I used, but three are set to '1' by the parallel interface circuit board. The range is set by the manufacturer to a limited range for each chip. As the manual says: "Address range of each of the PCF8574A chips in the interface is 56 to 63. ". The four switches on the interface are completing a 7-bit value in this range.

There are only two variables needed by any controlling software - chip address (7 bit) and data (8 bit).

Good to hear that it still works after all these years, and even at 3.5V. I am not sure the chip I used is designed for that voltage, so might not be 100% reliable.


User avatar
pjw
Gold Card
Posts: 472
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway

Re: TF Services Interfaces and BBC Micro:bit

Postby pjw » Fri Jan 18, 2019 1:38 pm

Welcome aboard, Tony! I hope youre here to stay!


Per
Be wary of large West-Coast corporations bearing gifts!
- Ancient Trojan proverb
User avatar
tonyfirshman
ROM Dongle
Posts: 4
Joined: Fri Jan 18, 2019 9:03 am

Re: TF Services Interfaces and BBC Micro:bit

Postby tonyfirshman » Fri Jan 18, 2019 2:23 pm

Maybe! I am connected to the QL now with a rubber band. I found this thread as Dilwyn's homepage (hosted on my server) had a charset error. However my QL knowledge was frozen 10 years ago (8-)#

It took me a little to work out who 'PJW' was. Do you still have your (long) hair? My beard is still there (whiter) but little on top.
How does one get these threads emailed, like all other forums do by default?


User avatar
tonyfirshman
ROM Dongle
Posts: 4
Joined: Fri Jan 18, 2019 9:03 am

Re: TF Services Interfaces and BBC Micro:bit

Postby tonyfirshman » Fri Jan 18, 2019 2:47 pm

Just worked out how to upload my image. Bad that the 'ONLINE' banner obscures part of it! ... and there seems to be no way to configure to post replies to threads I am involved in. If so that is very bad. I suspect then I will not see any replies, as I will forget tomorrow to follow up (8-)#

Also wouldn't it be a good idea if a welcome message was sent pointing out how to amend one's profile. Maybe that is to come!


User avatar
tonyfirshman
ROM Dongle
Posts: 4
Joined: Fri Jan 18, 2019 9:03 am

Re: TF Services Interfaces and BBC Micro:bit

Postby tonyfirshman » Fri Jan 18, 2019 2:51 pm

... and no 'edit' key. When I said 'post' replies, I meant 'email' replies, of course.


User avatar
tofro
QL Wafer Drive
Posts: 1507
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: TF Services Interfaces and BBC Micro:bit

Postby tofro » Fri Jan 18, 2019 3:34 pm

Tony,

you can configure notifications sent out via eMail when various conditions apply - see "User Profile (the guy on the top right)"->"User Control Panel", then "Board Preferences", then "Edit Notification Options". Check "Someone replies to a topic to which you are subscribed" and "Someone creates a topic in a forum to which you are subscribed" to get notified when a message in some topic you're interested pops up.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Derek_Stewart
QL Wafer Drive
Posts: 1216
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: TF Services Interfaces and BBC Micro:bit

Postby Derek_Stewart » Fri Jan 18, 2019 7:55 pm

Hi,

The Q68 has a I2C interface on tge board, which I have fitted a SIL header. All Tony's Inferfaces can be used.

The only problem is the lack of external I2C connector when the Q68 board is fitted into a case. I did think of fitting a 4 pin mini Din socket to the side, but this drilling the case and walls have thick metal, which cause problems.

A question about the Microbit, which is programmed by the USB port, can an emulator access the microbit?

Pity there is no Serial to USB adapter available...


Regards,

Derek

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest