RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sat Jul 20, 2019 7:22 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: I/O Scan
PostPosted: Mon Apr 30, 2012 9:40 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Telling which CPU port and pin is connected to which PCB pin is difficult. Schematics are sometimes not clear and sometimes not correct. Small PCB traces are hard to follow.

What to do?

I wrote small program in RetroForth. It periodically reads as inputs ports A to G and displays them. I plug a 1K resistor into the pin I am curious about and first apply GND and then VCC. I notice which bit changes.

Now I know FOR SURE which pin is controlled by which CPU port!

Next I automated my method. I set one known pin as an output and use the program to wiggle it. I connect the pin I am curious about to the wiggling pin. I notice which other pin now wiggles.

Now I have an easy way to be CERTAIN I am trying to control the right bit!

I write a simple shell script called 'ioscan' to start RetroForth and load and execute my new program.

'./retroforth --with ioscan.rx'

1 hour well spent.

Enjoy!

Wiz

 


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission