Monday, March 14, 2016

MCS-8031 mask Tiny Basic with Acey-ducey.

Rarer than GOLD !

  Something has been bugging me for years. I need to get it out in the public sphere before i loose the info and before the chips involved all end up in land fill.

 If anyone has every played with the old Intel ( and others) 8031 and 8051 controllers they should know they are the same chip except the 8031 had no internal ROM.  To force the 8031 to use external ROM the EA pin needs to be held low. We are told the 8031 had no internal ROM but most DO. Some have unstable ROM that change state with temperature . Some look like they are full of 0xFF. Some have code with errors but some have perfectly good and very interesting code. These good chips are 8051 runs where the customer cancelled the order or 'someone' made too many. Intel just move them to the 8031 chip labeling line.
Well i got addicted to pulling 8031 chips out of old circuit boards and popping them into an EPROM reader. 100's of them over 8 or so years.  Now and then i would see "copyright" text or ASCII lookup tables from serial buffers or keyboards. I got excited when i spotted the text in the dump shown in the image on the right.


Looking further down the dump were words that further picked my interest further. Words that i wouldn't have associated with brands like Intel or IBM.

I knew of several versions of 'Tiny Basic' source code and I even have a 40 pin Micromint 80c52 Tiny Basic chip, but I have never read of any Basic hidden in a ROMless 8031. These chips were recovered from an "IBM PC, Cluster card" ( The server end of the 1985 IBM PC JX coax networking system ).

I have three chips with Tiny Basic v2.2 in them. Two have a batch/mask number of L4370281 and one has L4411287. Note that these end the 280's. The one ending in 287 gives verify errors each time its read and gets hot when running.

I have spent a few hours with the DASMx threaded dissembler and can confirm its as close to the same code as Paul has on his PJRC Tiny Basic for 8051 page BUT his does not have the Acey-Ducey card game in ROM.


MCS-51 TINY BASIC V2.2
OK
>LIST
OK
>RAM
OK
>10 PRINT "Jeff"
>LIST
10 PRINT "Jeff"
OK
>RUN
Jeff
OK
>PROM
OK
>LIST
OK
>ROM
OK
>LIST





>RUN

HERE'S HOW YOU PLAY ACEY-DEUCEY:
I'LL DEAL TWO CARDS FACE UP.
YOU BET ON WHETHER THE NEXT CARD WILL HAVE
A VALUE BETWEEN THE FIRST TWO.

YOU NOW HAVE 100 DOLLARS.

HERE ARE YOUR NEXT TWO CARDS...

6
KING

PLACE YOUR BET: 50

AND YOUR LAST CARD IS A ... QUEEN
YOU WIN!!!

YOU NOW HAVE 150 DOLLARS.

HERE ARE YOUR NEXT TWO CARDS...

9
4

PLACE YOUR BET: 2

AND YOUR LAST CARD IS A ... 6
YOU WIN!!!

YOU NOW HAVE 152 DOLLARS.

HERE ARE YOUR NEXT TWO CARDS...

ACE
2

ACEY-DEUCEY - GOOD ODDS!!

PLACE YOUR BET: 152

AND YOUR LAST CARD IS A ... 2
SORRY, YOU LOSE.
FRIEND, YOU BLEW YOUR WAD.

TYPE 1 TO PLAY AGAIN    : 1


YOU NOW HAVE 100 DOLLARS.

HERE ARE YOUR NEXT TWO CARDS...

9
4

PLACE YOUR BET: 0

CHICKEN SHIT!!

AND YOUR LAST CARD IS A ... 6
YOU WIN!!!

YOU NOW HAVE 100 DOLLARS.

HERE ARE YOUR NEXT TWO CARDS...

5
4
MISDEAL

HERE ARE YOUR NEXT TWO CARDS...

QUEEN
6

PLACE YOUR BET: 100

AND YOUR LAST CARD IS A ... KING
SORRY, YOU LOSE.
FRIEND, YOU BLEW YOUR WAD.

TYPE 1 TO PLAY AGAIN    : 0

OK

>RAM
OK
>LIST
10 PRINT "Jeff"
OK
>RUN
Jeff
OK
>

The game code doe not need RAM. My "10 print Jeff" does. I added this to show you that visible basic code changes depending on the memory mode you are in.

Below is a sample Intel batch /FPO number key for an OLD intel forum post.
It looks to match some of the older chips i have but not 20% of.
Even with a L as the first letter I have an 8031 with Japan stamped into the underside.

I have also now found another L4411287 that does NOT have Tiny Basic in it and has SINGAPORE 8440 ZM printed on its belly in large silver characters.

 Example: L149A463-0726
1st letter or digit = plant code (Malay)
0 = San Jose, Costa Rica
1 = Cavite, Philippines
3 = .............., Costa Rica
6 = Chandler, Arizona
7 = .........., Philippines
8 = Leixlip, Ireland
9 = Penang, Malaysia
L = ............, Malaysia   ( hmmm... Not on My Chips )
Q = ..........., Malaysia
R = Manila, Philippines
Y = Leixlip, Ireland
2nd digit = Year of production (2001)
3rd & 4th digits = week (49th week )
5th - 8th digits= lot number
10th - 13th digits = serialization code


So please let me know if you find other Tiny Basic or interesting code in chips with different batch/mask numbers.

ta,



A few days after i started putting this Blog up i went back through some of the old 8031 chips as well as sucked a few more from old PCBs.  Look what I just found, another interesting 8031 with MCS-51 MONITOR X2.1 in it.






Tuesday, June 16, 2015

Emergency Garmin FR220 charger clip.


OK.. i'm in the far south of Sulawesi at a lovely cabin stay and want to log a run... bugger... the 220 is at 10% and i forgot the charger clip.
The USB clip and fr220 have 4 contact points so i assumed there were normal USB connections.
 +ve, data, data , -ve
Nothing on google.... and i didn't have a multi-meter or test LED with me...

Ah. stuff it..
I cut a generic USB lead , cut the two data wires which left me with the red and black.
Stripped them and pulled one strand of the fine copper wire , folding the rest back out of the way.
This gave me a very fine probing wire that would act as a very crude 250mA or there abouts fuse.
I tossed a coin to choose if the black goes to the left or right contact on the back of the watch.
Looking at the back of the watch, contacts at the bottom i connected Red to the left , Black to the far right. "Beep"... sounds good.. struggle to turn the watch over... bugger the watch was coming back from a reset.  I swapped the wires and tried again, this time facing the screen side at a mirror.
"Beep" ... but this time the watch went into its normal 'Charging' screen.
Well that was easy.

Now to make the clip... Cardboard with its ribs running up and down the watch should be stiff enough but allow the tabs to fold around the watch to hold the contacts against the pads on the back of the watch.
Trace around the watch, leaving room at the sides to not press on the buttons ( we don't want it going into Test Mode do we ;-)




Tracing showing rough location of contact points.

With a pin i then poked holes through the cardboard that aligned with the pads on the watch and poked the wires through. NOTE polarity ! 



I then stripped about 20mm of the insulation from each wire, twisted the strands together and then rolled the twisted strands into balls that were just firm enough to press firmly against the pads but not to soft that they would crush and get loose.

Twist strands then roll into firm balls.
I connected the other end of the cable to a USB power bank and held the cardboard creation on the back of the watch.  Ripper , it worked the first time !

( no idea why Blogger wont let me flip the image ! )
I wasn't going to hold the thing in place for an hour or so. Thats what the wings on the side of the cardboard were for. Wrap them around the watch, secure with a rubber band and leave it for a while.



After a few minutes i heard a beep...um... it may have stopped charging... i cant see the screen. 
Easy fix , cut a bit off the wings.


This setup worked without a single problem or missed charge for the rest of the 2 week holiday. Packed and unpacked 4 or 5 times from my carry on.

 Hope it helps someone one day.

 HooRoo,
  

Tuesday, March 17, 2015

Garmin Forerunner FR220 'What else can it do...'


 Morning,
 This is a spin off of my other FR220 post. This one will cover stuff that we can do with the 220 and probably the 620 that involves messing with the setup files but does not require messing with the firmware.

Here is a teaser that i'll get to ....



While corresponding with a new friend about my work on the test mode data EPO status, this new friend ( Lets call him 'MiniQ') started investigating the SETTINGS and 0RRUNNIN .FIT files.
MiniQ wanted to be able to select a slower Virtual Partner WALK pace than the slowest available in the watch  ( 8.55min/KM). After many hours of  bit twiddling MiniQ sent me an email  " Now I've successfully raced the Virtual Partner while walking (VP pace set to 14:00/km). I WON! :-)
He passed on info on how the activity screen metrics are indexed on the FR620 and where the number of fields per screen was stored. Here is a list of the 620 metrics.
I have since found the same metrics have the same index number on all garmin forerunner devices. 910,920,620,220 and fr10. I hope to create a full list . Anyone got one before i start ?
I re-ran his tests on the FR220 and here are my results based on his hours of work.
Seeing that the FR620 can display up to 4 screens of fields and the FR220 can only display up to 2 screens of 3 i wanted to see if i could enable more...

Testing every combination i can not get more than 2 activity screens but CAN set both to 4 fields !

You will need 

  1. Hex editor to edit the .FIT file.
  2. The ANT .FIT SDK  ( i use the FitTestTool.jar JAVA script from it to create the new checksum for the modifyed .FIT ) 
  3. Some DOS skills if you do it the way i do it . MiniQ uses Unix scripts. 


MiniQ found the FR620's first activity screen settings started at address 0x0280 in the 0RRUNNIN.FIT file.
0RRUNNIN.FIT is found in the GARMIN\SPORTS folder on the watch.

Here is what the header looks like in the hex editor.




Here is the bit around address 280hex we are interested in..



Grab your current 0RRUNNIN.FIT file and drop it in the working folder on your computer.
( Excuse the mess. I hate path problems so put the utils and data in the same folder.)

Run the FitTestTool over your .FIT to make sure its ok and that you can run the tool.

D:\Downloads\Garmin\FitSDKRelease_14.00\java>java -jar fittesttool.jar -d 0RRUNNIN.FIT > 0RRUNNIN.txt

 This will create a .txt file like the section below. ( open it in Wordpad if on a PC to keep correct newline formatting).

To help make things clear i have made an indexed version with Decimal and Hex and comments. 


(*** Screens The 3rd and 4th screens above maybe wrong. i'll update the pic and text ASAP.)


Here you can see the Activity screen settings at the time were Screen 1 Enabled and showing 3 fields, Distance , Timer , Elevation.  Activity Screen 2 was Enabled and only showing 2 fields, Average Pace and Speed. The HRM screen was NOT enabled but if it was it would have shown 2 fields, HR and HR Zone ( there are the default for HR and not adjustable from the watch menu. The 4th screen would be the Workout screen. It was NOT enabled but would have shown Average Pace, Average HR and Time Of Day.

The fields in the green text are normal metrics for the two main FR220 activity screens. The others were only available when the extra HR and workout screens were enabled but look to be available on the main activity screens if added via the 0RRUNNIN.FIT

Dec  Hex   Metric         Comment                                                           
0   0x00  Calories        Calories burned during the current workout.
3   0x03  Cadence         Number of steps per minute.

6   0x06  Distance        Distance travelled during the current activity.
7   0x07  Lap Distance    Distance travelled during the current lap.
9   0x09  Elevation       Current altitude above sea level.

13  0x0d  Heart Rate      Current heart rate (heart beats per minute, bpm).
14  0x0e  Average HR      Average heart rate for the current activity.

16  0x10  HR %Max.        Percentage of maximum heart rate.

19  0x13  %HRR            Percent of heart rate reserve (HRR=MaxHR-RestingHR).

22  0x16  HR Zone         Current heart rate zone (1..5).
23  0x17  Heart Rate      Ibid nr 13 decimal - duplicate?]

33  0x21  Pace            Current pace.
34  0x22  Average Pace    Average pace for the current activity.
35  0x23  Lap Pace        Average pace for the current lap.
48  0x30  Speed           Current speed.

50  0x32  Lap Speed       “ Unknown _ _ _ _ . _ “

56  0x38  Timer           Stopwatch: Duration of activity. Paused if stopped.
58  0x3a  Lap Time        Elapsed time for the current lap.
59  0x3b  Time of Day     Current time of day

64  0x40  Calories to Go  Remaining calories to burn. If workout target]
65  0x41  Distance to Go  Remaining distance. If set as a workout target]
66  0x42  HR to Go        Difference between current HR and workout HR target]
67  0x43  Repetition      Repetition ? no lines or numbers; “
68  0x44  Time to Go      Remaining time during workout. If a time target is set]
_______________________________________________________________________________

I can get a max of 2 screens of 1 to 4 fields.
I have not run with the other two screens we can get on a 220 that are for HR and Workout with other field numbers entered into screens 3 to 8.
_____________________________________________________________________________

I have been running and riding with 4 fields for 4 weeks now and its stable and required no clunky workarounds. The only drawback is that once you enable the 4th field you are stuck with the selected 4th field until you do a hard reset or replace the 0RRUNNIN.FIT file. You can change the first 1, 2 or 3 fields to any of the normal metrics from the watch menu as before.

Lets make Activity Screen 1 a 4 field screen showing LapTime, Speed, Pace and Timer.
I put timer last as its a field that i would always have on a screen. This allows me to add and change the first 3 from the watch at any time.

From the above table we need. Laptime (3A), Speed ( 30), Pace (21) and Timer( 38).
Copy your 0RRUNNIN.FIT to your PC as above.
Open it with the hex editor.
Edit addresses 0x28A to 0x3A, 0x28B to 0x30, 0x28C to 0x21, 0x28D to 0x38.
Edit address 0x291 to 0x04 to enable the 4 data fields.
Save the file.
All done... Not quite.. for the watch to suck the .FIT file into to its belly it needs to make sure the file is correctly formed and not corrupt. We have not messed with its format but will have changed the checksum of the file.
There maybe other tools out there to create a new 16bit checksum but i use the FIT tool tester.
Re-run the tool over the new .FIT and look at the last few lines.

java -jar fittesttool.jar -d 0RRUNNIN.FIT 

Your should see a 'File integrity failure' error.
Take note of the hex number at the end of the 3rd last line. The below example is E873.



Take the E8 and the 73, reverse them and with the hex editor put them into the LAST 2 locations in the .FIT file you are working on.



Save it and re-run the fit test tool.


Dont worry about the last 2 lines that show an error. As long as the CRC and the last 2 bytes match you are done.

At this point you have not changed anything on your watch at all. If you do proceed from here and IF it screws up your watch don't come crying to me. Its your choice and and you do so at your risk.


Replace the 0RRINNIN.FIT on your watch in the GARMIN\NEWFILES folder.
When you unplug the watch from the USB clip you should see it 'Updating' for a few seconds.

That's it. go into your watch activity screen menu or just press start, start to see how 4 fields looks. ( you may need your glasses ;-)





Thursday, March 5, 2015

Garmin Forerunner FR220 Test Mode.

Garmin FR220 training for a 1/2 marathon.

Good morning anyone ;-)
I love to run...more than 2 km but at this stage less than 30 km..Road , track , hills, Hot..
After 4 years of random training, my times were with-in 2 minutes of a 90 minute 1/2 marathon. I needed to train smarter & better.
My old Polar watch died so having Garmin Forerunner watches burned into my mind as the top of the pile, i jumped on the early adopters list for a new Garmin Forerunner 220...  Garmin look to do both Alpha and Beta testing of products on production user purchased devices. My opinion is if you want to purchase a watch, not have to do updates and just want to go running, then don't get a Garmin watch that has been out for less then 12 months. Pre-read the Garmin Forums and Ray's site http://www.dcrainmaker.com/

It had a few ( cough..cough) bugs when it was first released in November 2013, but by firmware version 2.90 it was stable and very usable for distance running.

Basing my training on the Hanson method of training for the last 16 miles, not the first.And using heart rate zones based on LTRH i had the best 18 weeks of running that eventuated in getting under 90 minutes with energy to share ! 87 minutes for the Gold coast half in July 2014.

OK... what now.... hm... time to play with this USB/Bluetooth connected device....
The watch mounts like a USB memory device.. several folders with settings, logs , activities... nothing all that interesting for now...

_____________________________________________________

 TEST Mode.


Most Garmin devices have a TEST MODE.. it only took a few minutes to find Test Mode on the FR220.

Power it off.
Hold in the UP and Down buttons ( lower left two) while powering the watch on with the light button ( top left). Release the light button but keep the other two pressed for over 7 seconds.

You should get the first image in the below photo.

Pressing the LAP button ( lower right) steps through the other test screens before looping back to the first screen.

When on screen 1 pressing the start/stop button ( top right) turns the vibrate motor on and off.

On screen 2 the start button steps through a range of LCD colour and alignment screens.

Screen 3 is a button test screen.

Screen 4 is GPS, Heart rate and footpod test screen. If you have a footpod or HRM on and in range it should display their serial numbers and some times my unit shows movement data.
The GPS test is in 'GPS TEST' mode by default. Pressing the light button toggles between TEST and FULL. When in full the watch turns on the internal GPS and displays the SNR ( Signal noise ratio ). I have found it to display a nIumber between 16.00 and 28.00 if it can just see one or two satellites but would not show GPS lock if you were to have it in normal mode and want to run. An SNR of over 42.00 is very good. Normally I see mid 30s when in clear open sky's.

Test screen 5 just looks like a back light, contrast and pixel test screen. Pressing start button just flashes a black refresh or something up the screen.

Screen 6 is the 3 axis accelerator test screen.

Screen 7 is ANT test mode. you can turn on and off ANT test mode and switch between 3 carrier frequencies. Love to know if anyone knows how to put this to use ?

The last test screen is the Blue tooth 4/ BLE test screen. Several selections of tx rx freq and channels are available. Again i have not done anything with this mode.

So that was it.
Usefulness .... We can see the battery voltage , and if the watch is getting a good satellite signal.
                         ___________________________________________________

USB conversations when in Test Mode.

When the watch is docked into its USB cradle and powered it shows the battery charge level in %.
Unlike some previous Garmin watches you can not charge the watch while using it for an activity.

I had the idea to see if the USB drive looked different when i try to connect to it with it in TEST MODE. It didn't jump to the usual % charged mode , it stayed in TEST MODE and was not mounted as before in USB memory stick mode.

I tried to talk to the watch using all number of terminal emulators and GPS tools with NO response at all... until i used the free version of GPSU52.  ( I may have loaded the 'GarminUSBdriver'  by this stage as well.)

Here are the settings that worked for me.



Open 'Interface Monitor' in the GPS menu.
Then click 'Connect' in the same menu.
BINGO !...well its something..


Poking keys did nothing more.. but when i clicked 'Connect' for the second time i got this:

As the red annotation on the image shows, converting the hex string returned by the watch to characters tells me i have good data from the watch.

Web searching for a few hours found a few very old docs on Garmin USB protocols but nothing that looks like the record types in the above image.
Wait a minute.. back when playing with TEST Mode, screen 4 allows for TEST and FULL GPS testing. The above dump was in TEST mode, not full.. lets look at the data in Full mode.


The FULL mode dump was taken outside with clear a clear sky. Googling finds that record type 99 looks not to have been decoded, but there is some info out there on type 72 ( Satellite Data Record ). See page 15 of this doc).

Now lets pull apart one type 72 record.

Now lets pull out each field.
The data in the green box should be the GPS satellite number, Elevation and Azimuth at the time i did the capture ( Bendigo Victoria Australia, 5:33PM 13-March-2015 DST ).

The staus bits do not look to match 100% with the document. More work needs to be done on this. Got any ideas ?

I used the Trimble web site to take a snapshot of a skymap that i hope will show the GPS satellites that should have been visible to the watch at the time of the capture.


Your Beauty ! All 9 satellites reported by the watch were in view at the time AND each elevation and azimuth are with in 1 unit of the watch ! ( Sat#21 is under the QZSS data box in the above image).
By the way the QZSS satellite is the first of 3 Japanese satellites that will allow us in this side of the world to have GPS lock in built-up streets, canyons and in doors through windows.








Wednesday, December 3, 2014

PicAXE AXE102 board full Schematic.


Early this year my son did a Systems project that required him to use a PicAXE circuit based on the AXE102 alarm board.
I was not able to find a full schematic so put the below diagram together. Hope it saves someone a few hours in the future.
( Oh, Careful if you do play with the school version of the AXE102 board. The chip may be a "08M-LE". Its a cut down version of the 08M with less ram and can only run one thread ).


While on the subject of PicAXE documentation. I am dissapointed that having pointed out to Picaxe.com that they have an error in their public facing AXE102 page in September that it is still incorrect.


Wednesday, November 19, 2014

Reverse Engineer HP 3550 LCD protocol

Well I hate to see things go to land fill so i pull usable bits from all sorts of electronic devices as well as dabble in a bit of scrap metal.
Anyway , i pulled a HP 3550 colour printer apart thinking it would contain yet another HD447800 text based LCD in it.  Hmmm.. Na.. its a 28 pin graphic lcd ( GLCD) .



There are 3 LEDs and 7 push button switches. There is one chip, a BU6740AK . A web search shows no one has much if any data on it.
But there is a WordPress blogger called Kbiva that has done a few HP printer displays before that use this chip.  Power , Ground, and 3 SPI pins sounds easy.. lets see what my new Bus Pirate tells me.
Hmm.. not much... I think i worked out what pins are what but the BP can only work up to about 1 meg. The 3550 LCD SPI looks to be faster than 1 meg. I was getting malformed SPI data.
So i ordered an 8 Chanel 24 meg Ebay Logic analyzer for under $10.
[ Insert a 10 day wait and stalking the mailbox HERE]
After 2 days of getting the new LA and playing with the Saleae software, i was ready to sus out what pins do what on the 3550 LCD.
I'll add the pinout here in a day ot two.
The SPI is running at just over 1 Mbps.

Below are the settings i found that worked for me. They are not the same as Kbiva used.



I did not get a screen shot of live data in the LA software but i'm sure you can search for examples if needed.

I captured several power up initializations as well as one with each of the buttons pushed down , and three that cover enough combinations of LEDs to know which is which.
I decided to export the LA data to CSV files that allows me to sort and colour the data to work out what bits do what. The below Dump1 may look messy, but it contains a lot of info...
The yellow bars across these extracts shown where i have cut out repetitive data.
I can see no LCD initialization section. For now i will assume there is a basic one to clear the screen and setup biases and basic register settings between the chip and the LCD.


Dunp 1 - Init Codes

0xA000 may be a reset out to the board.
0x0000 looks to be a clear buffer flush. Its used between raster , changing LEDs and sometimes before starting a new raster update of the LCD.
0x30xx (Green numbers)  look to be LCD command selection.
0x70XX is outgoing data to the LCD or to an LCD command.
0x0800 looks to be a request for the controller status OR what switch has been released.
0x0900 looks to be a request for what switch has been pressed.
0x90X0 is used to turn on and off the LEDs.

A one off Initialization of sending 0xA000 and 0x0000 is then followed by a loop that waits until sending 0x0800 returns something other than 0x4001. ( Green block 0)
I think sending a 0x3004 , 0x7003 may be Clear Screen. (Violet block 1)
Next ( Blue block 2) looks to be setting the address to top left. The 0x70C0 is always the same but the 0x70XX after the 0x3004 increments from 0x00 through to 0x13 ( 20dec) as the columns are addressed.
The pixel data is fed in until the last lower right byte is sent ( Pink block 3)

Then starts a whole new screen update from top left again, but this time and then for all new screen updates we have the added config starting with 0x3002.

Each of the 0x70XX following a 0x30XX shown in the two Dumps here are the same in all my dumps with the exception of the data following the 0x3004 ( addressing) and 0x3007 ( i think is either here comes pixel data or Auto increment address with data).

I knew i was in the ball park when i spotted the binary in lines 1755 to 1760 in the above image.
A little ASCII art shows i have an Asterisk that matches the ones on the LCD at the time while the printer is initializing. Further trawling through the spread sheet found the memory test digits and "MB" characters that also told me i had the bits the correct way around. 


The LCD turns out to be 32 x 160 pixels ( 32 rows of 20x8bits ).
With the way the data is sent from SPI to the LCD  and the yet to be found initialisation settings, the byte pixel data is top left to bottom right.


Dump2 - LEDs and Switches

Switches look to be read between screen updates or every 0.1 seconds.
LED updates or toggles are on 0.250 sec ticks.

Sw11= 11101111 OFF 0x9000 00000000
Sw12= 11110111 LED1 0x9010 00010000
Sw13= 11111011 LED2 0x9020 00100000
Sw14= 11111101 LED3 0x9040 01000000
Sw15= 11111110
Sw16= 01111111
Sw17=  10111111


I have not been able to find any GLCD controller chips with commands and registers with numbers like the ones in the right two digits of the 0x30XX and 0x70XX in the dumps.

I have enough to connect an Arduino up to replicate the above method of putting data on the LCD. I would like to find that the controller can also do character mode.


I connected the 8 channel LA to the 8 data pins on the LCD display its self.  The data is exactly the same as the last byte of the data sent via the SPI bus. I sort of thought they may have been interpreted and sent to the LCD is a string of raw commands, but no.
The data to the LCD its self is clocked in 8 bits wide at about 30 uS 

I hope someone can tell me what controller this display looks to be running.

Tuesday, October 14, 2014

Ebay Arduino Pro Mini boards that are not...


 While purchasing the pressure sender in my last post i picked up two " Arduino Pro Mini compatible" boards for a few dollars each.
 When they turned up i did the usual print out a copy of a schematic and pin out i found on line... Hmmm... the pin out of the programming header on the end of the board is NOT the same as the standard Arduino Pro Mini. Its more like that of the Mini. So be careful. they are swapped end for end.
OK , power it up.. Yes ! , the led blinks like a bootloader loaded Arduino should.. Buttt.. it was blinking at 4 times per second and not once a second! Someone got the fuses or timer pre-scaler wrong.  Bugger.
( I have since found out that some people have been able to talk to the bootloader in this mode by changing the serial baud rate of the programmer.)

After a few hours i managed to get my SparkFun AVR Pocket Programmer to talk to the board using the below command lines.

avrdude -b 19200 -c usbtiny -p m328p -v -e -U efuse:w:0x05:m -U hfuse:w:0xD6:m -U lfuse:w:0xFF:m

avrdude -b19200 -c usbtiny -p m328p -v -e -U flash:w:hexfilename.hex -U lock:w:0x0F:m

(ArduinoIDE 1.0.6 insists on trying to talk to the usbtiny via a com port when the new driver is pure usb. each time i want to use this programmer i have to edit the 'preferences.txt' file that in C:\Users\\AppData\Roaming\Arduino. Remove the 5 or so lines that start with "serial." and save the file.)
( I like others can only upload by selecting 'Upload using programmer' from in the file TAB, the Upload button (>) generates an error at the end of the upload script.)

I connected the programmer to the Pro Mini with jumper leads and pushed out a new bootloader for a 5v, 16meg M328P. All was good again. One second duty cycle on the LED Blink.

Next was to talk to the board with a cheapy CP2102 USB-2-Serial(TTL) board. I did the usual reading up other peoples past experience and got it working by adding a 1 uF cap from the DTR pin on the USB-2-serial board to the reset line on the Ebay Pro Mini.
After a few days i wanted to clean up the 5 mini jumper wires that everyone uses nowadays and make a 5 to 5 or 6 to 6 plug set. While considering how to get the reset trace of the Pro Mini to one of the pins along the end of the board i noticed the end pin on the Pro Mini is labeled "DTR" and not RST. Tracing the board with a meter found a 0.1 uF cap already on the PCB connected to the reset pin of the CPU !!! I think there are a lot of people out there using old info and spending wasted time getting the auto reset working on the newer Pro Mini boards.

Yellow arrow is DTR pin from the CP2102 board extended out inline with the other pins.
The green arrow shows the "DTR" text that indicated the capacitor is already on the board.
The red circle is a reminder that my Pro Mini goes TX, RX, VCC, Gnd from this view.

So, i now have a 5 to 5 header cable that runs between the two tiny boards. The DTR auto reset asserted by the avrdude software and within Arduino IDE works every time now.

Arduino IDE settings when using the CP2102 board:
  •        Board= "Arduino Pro or Pro mini"
  •        Serial Port =" Com 11"   ( your setting maybe different ) 
  •        Programmer= "AVRISP MKII"