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

Post by henry's cat »

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
Over Heated PSU
Posts: 126
Joined: Tue Oct 24, 2017 4:04 pm

Re: TF Services Interfaces and BBC Micro:bit

Post by Whopper »

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
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: TF Services Interfaces and BBC Micro:bit

Post by NormanDunbar »

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?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
tonyfirshman
ROM Dongle
Posts: 4
Joined: Fri Jan 18, 2019 9:03 am

Re: TF Services Interfaces and BBC Micro:bit

Post by tonyfirshman »

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
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: TF Services Interfaces and BBC Micro:bit

Post by pjw »

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


Per
dont be happy. worry
- ?
User avatar
tonyfirshman
ROM Dongle
Posts: 4
Joined: Fri Jan 18, 2019 9:03 am

Re: TF Services Interfaces and BBC Micro:bit

Post by tonyfirshman »

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

Post by tonyfirshman »

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

Post by tonyfirshman »

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


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: TF Services Interfaces and BBC Micro:bit

Post by tofro »

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
Font of All Knowledge
Posts: 3929
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: TF Services Interfaces and BBC Micro:bit

Post by Derek_Stewart »

Hi,

The Q68 has a I2C interface on the board, which I have fitted a SIL header. All Tony's Interfaces 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...
Last edited by Derek_Stewart on Tue Mar 12, 2024 4:37 pm, edited 1 time in total.


Regards,

Derek
Post Reply