Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  H120 remote control
« previous next »
  • Print
Pages: 1 [2] 3

Author Topic: H120 remote control  (Read 8685 times)

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: H120 remote control
« Reply #15 on: June 07, 2011, 07:42:23 PM »
If FS#8569 goes in might not need to add those buttons at all. That change would then require a bit of changes to the controller software but that's about it. I don't agree with the non-LCD remote being useless without that patch but the idea is quite useful.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline pondlife

  • Developer
  • Member
  • *
  • Posts: 248
Re: H120 remote control
« Reply #16 on: June 08, 2011, 03:22:53 AM »
IIRC, the "useless" part was when I hit a Yes/No screen (typically "Erase Dynamic Playlist")  and couldn't reply "Yes"..  it's been a long time though, I may be misremembering.

pondlife
Logged

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #17 on: June 10, 2011, 12:18:31 PM »
I like the sound of a patch which would mean less work for me!

On a side note, are the mappings of SV1 the same for LCD and non-LCD remotes?  I note the RMC line does not link to SV1 (I'm assuming it is linked to the non-audio plug input).  With so many LCD-related inputs on my remote, it makes sense the mapping could be different.  Am I just confusing myself unnecessarily?   I've attached the diagram of the LCD remote plugs from the hardware page.  As you started with an LCD remote are you able to shed any more light on this?

Thanks...

(If I have time this weekend, I'll try the LCD patch)

* LCD_Remote_IO.jpg (19.46 kB, 200x200 - viewed 147 times.)
« Last Edit: June 10, 2011, 12:22:43 PM by bonapardo »
Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: H120 remote control
« Reply #18 on: June 11, 2011, 01:19:13 PM »
Quote from: bonapardo on June 10, 2011, 12:18:31 PM
On a side note, are the mappings of SV1 the same for LCD and non-LCD remotes?

What are you referring to as SV1? There is no such label in both the pinout in your post and the last circuit.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #19 on: June 11, 2011, 03:51:32 PM »
Apologies, I assumed SV1 (see attached) was the connector on the remote lead...


* SV1.jpg (26.47 kB, 289x115 - viewed 151 times.)
Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: H120 remote control
« Reply #20 on: June 11, 2011, 04:29:21 PM »
Ah, no. SV1 is the ISP connector for programming the controller. Maybe I should rename that one :)

The remote doesn't have any connectors in the circuit, just pads. That's simply because there is no connector on the cable, and artificially adding one seems a bit over the top to me -- just solder the wires directly to the circuit.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #21 on: June 13, 2011, 07:13:08 AM »
Ah, it makes sense now!  With regards to the connector, I'm talking about the plug to go into the player - I'll be working with a severed plug (i.e. wires at one end for the circuit, plug at other end for iRiver).  Now I've eliminated SV1 as being part of the remote (!) and as the circuit only addresses some of the wires for an LCD remote (obviously we do not need any of the LCD-related lines), will I be okay connecting my plug to the circuit only, or do you think it is it safer to keep the other wires connected to an LCD remote for completeness?

Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: H120 remote control
« Reply #22 on: June 13, 2011, 12:32:31 PM »
Quote from: bonapardo on June 13, 2011, 07:13:08 AM
Now I've eliminated SV1 as being part of the remote (!) and as the circuit only addresses some of the wires for an LCD remote (obviously we do not need any of the LCD-related lines), will I be okay connecting my plug to the circuit only, or do you think it is it safer to keep the other wires connected to an LCD remote for completeness?

You don't need additional LCD connections. In fact I cut the connector off of a LCD remote and only wired the needed lines -- works fine for me. As for SV1 (I've renamed it btw) don't forget that you still need to program the controller.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #23 on: July 05, 2011, 09:10:20 AM »
Been a while, but I've finally received the ATMEL chip (actually bought a few in case I can use them in future) and programmer.  Am about to order the IR receiver and resistors.  The receiver was easy to track down, but resistors seem to be a can of worms - I can filter by resistance but still getting hundreds of results on the component vendor site.  Is there a specific type I should be looking for (apart from the actual resistance value)?  There also appear to be the classic resistor types and ones that look more like chips.  Do the other, non-ohm properties of the resistor make much difference? 

I am searching on uk.farnell.com.

Thanks!
Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: H120 remote control
« Reply #24 on: July 05, 2011, 01:10:28 PM »
Quote from: bonapardo on July 05, 2011, 09:10:20 AM
The receiver was easy to track down, but resistors seem to be a can of worms - I can filter by resistance but still getting hundreds of results on the component vendor site.  Is there a specific type I should be looking for (apart from the actual resistance value)?  There also appear to be the classic resistor types and ones that look more like chips.  Do the other, non-ohm properties of the resistor make much difference? 

No, not really -- the only really important thing is the resistance. I'm usually using resistors with 1% or 5% tolerance and 0.25W (wired) or 100mW (chip) -- it really doesn't matter much for this type of application. That's also the kind of resistors I get at the local store when just asking for resistors. Something like Farnell part number 9341129 or 9333738RL
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #25 on: July 06, 2011, 05:22:39 AM »
Once more, thanks again.  My approach will be to build your circuit first, get it working then make the LCD amendments.  I managed to get hold of a non-LCD remote so I have a reference for obtaining the appropriate LCD resistance values.  I'm a software developer by trade so as well as creating the remote itself, I'm looking forward to programming my first microcontroller.

I'll keep this thread updated with my progress and hopefully at some point will have an LCD circuit diagram to add to your project page...

Logged

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #26 on: July 18, 2011, 07:47:59 AM »
Still on a bit of a learning curve, with the basics of AVR programming in addition to getting my head around circuits in general.

At the weekend, I had a bit of trouble recognising the ATMEL chip (in my case, the ATTiny2313) in circuit, so I ended up creating a separate breadboard circuit to do the programming, which now seems to flash the chip as expected (with PonyProg).

I had a couple of questions about the circuit but tidied up my breadboard and it all makes a lot more sense now.  However, I do have a quick question about the code...

When compiling (using the tools in WinAVR), I get the following errors:

Compiling C: rc5.c
avr-gcc -c -mmcu=attiny2313 -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./rc5.lst  -std=gnu99 -MMD -MP -MF .dep/rc5.o.d rc5.c -o rc5.o
rc5.c: In function '__vector_6':
rc5.c:35: error: expected ')' before numeric constant
rc5.c:44: error: expected ')' before numeric constant
rc5.c:47: error: expected ')' before numeric constant
make.exe: *** [rc5.o] Error 1


This is the code section:


35]      if( ++rc5_time > PULSE_MAX ){               /* count pulse time */
          if( !(tmp & 0x4000) && tmp & 0x2000 )   /* only if 14 bits received */
              rc5_data = tmp;
          tmp = 0;
      }
   
      if( (rc5_bit ^ xRC5_IN) & 1<<xRC5 ){        /* change detect */
          rc5_bit = ~rc5_bit;                     /* 0x00 -> 0xFF -> 0x00 */
   
44]          if( rc5_time < PULSE_MIN )               /* to short */
              tmp = 0;
   
47]          if( !tmp || rc5_time > PULSE_1_2 ){     /* start or long pulse time */
              if( !(tmp & 0x4000) )               /* not to many bits */
                  tmp <<= 1;                      /* shift */
              if( !(rc5_bit & 1<<xRC5) )          /* inverted bit */
                  tmp |= 1;                       /* insert new bit */



Seems to be related to the PULSE_ constants.  When I replaced these with zeros, I was able to compile.  If their values are dependent on output from the IC, do the constants need to be initialised/instantiated before compilation?  Could it be I need slightly different code for the ATTiny?  Ill try to compile for the chip in your circuit tomorrow (I've read they should be pretty much interchangeable).

Thanks again, I'm nearly there!



Post Merge: July 19, 2011, 05:57:43 AM
I installed a different version of WinAVR and can now compile...

« Last Edit: July 19, 2011, 05:57:44 AM by bonapardo »
Logged

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #27 on: July 20, 2011, 09:58:07 AM »
My chip has been flashed (in circuit this time).  The hex file has been verified through PonyProg.

However, I'm not getting any response from my Hauppauge remote.  The remote and its transport buttons definitely work, I tested using WinTV and its integration with media players on my PC.

From looking at the code, I expect the LED to light up when I press a button.  I even created a second circuit, stripped down to just the Receiver, LED and associated resistors.  That doesn't seem to work either (although admittedly I'm not sure if removing the other elements breaks the circuit as a whole and did not amend the code, simply detached components from the circuit).  I also tested the IR reciever and that the circuit is being fed the approx 3.3V from the iRiver and both seem to be fine.

Do you have any advice on testing my chip?  I can't afford AVR Dragon just for this project, but it would be helpful if I could work out whether anything is being processed in my chip.  Would it be possible to fry the chip with 6V (I did connect four 1.5V batteries at one point)?  Is it possible to have a chip that flashes but does not run the code it's been flashed with?  I have four chips I can test with, two of which so far do not seem to be running the code.

Tonight, as a test of the chip itself, I will attempt a much simpler program to simply light an LED.  If that works, I'll return to your project to strip out all code not related to receiver and LED and re-test that.  If you have any advice it would be much appreciated.  I have tried to use a number of simulation tools but the ones I've looked at do not simulate the ATTiny2313 specifically and end up giving me compilation errors.

So close, but so far..!

« Last Edit: July 20, 2011, 10:01:22 AM by bonapardo »
Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: H120 remote control
« Reply #28 on: July 20, 2011, 10:30:36 AM »
Oh, I forgot to document the fuse settings -- you need to change the controller to use 8MHz instead of the default 1MHz. I'll check / update the documentation later today (no access to the circuit right now).

Sorry for the problems caused :(
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline bonapardo

  • Member
  • *
  • Posts: 21
Re: H120 remote control
« Reply #29 on: July 20, 2011, 11:39:05 AM »
No problem at all!  I've tried out a number of IDEs (I just installed AVR Studio 5 which uses Visual Studio 2010 - nice for Microsoft heads like me) and been learning about all sorts of other things along the way so it has been far from a waste of time by any means.  These microcontrollers are inspiring plenty of other ideas - if I'm not careful, soon I'll be controlling my curtains via an ATMEL chip!  I do have another IR project I'll want to complete after this one to control a DC motor.  If that ever happens, I'll create a gitHub project for it and give you the props you deserve!

I'll try the fuse change later...

Post Merge: July 20, 2011, 03:20:37 PM
Thanks for the fuse tip.  I just unprogrammed the CKDIV8 fuse and now I get the LED lighting up whenever I press a button.  So I know the chip is fine and I'm flashing it correctly.  Nice.  However, the LED remains on and I have to press again to turn it off (rather than turning off when I release).  All buttons have the same effect and can disable the LED if lit up by another button.  I'm not getting any response from the iRiver at the moment. 

I'm about to make sure all other ATTiny defaults remain in case I've accidentally overwritten some but if you have any ideas...

Your help is VERY much appreciated!

(also, as I'm in a position to test the circuit and program, please let me know if you'd prefer my enquiries to go through the project page from now on)


Post Merge: July 20, 2011, 03:30:13 PM
UPDATE: Defaults appear fine...
« Last Edit: July 20, 2011, 03:30:13 PM by bonapardo »
Logged

  • Print
Pages: 1 [2] 3
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  H120 remote control
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.077 seconds with 15 queries.